Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Second Saturday of the Month

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Second Saturday of the Month
 Login/Join
 
Gold member
posted
Hi

how to find the "Second Saturday of the Month"

can any one help me plz

Thanks
Smiler

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 51 | Registered: December 01, 2010Report This Post
Member
posted Hide Post
For 1st Week day-> WHERE &CDAY LE 7
For 2nd Week day-> WHERE &CDAY GE 8 AND &CDAY LE 14



-SET &ECHO=ALL;

-SET &CURDATE=&YYMD;
-SET &CDAY=EDIT(&CURDATE,'$$$$$$99');
-RUN

DEFINE FILE CAR
CDATE/I8YYMD=&CURDATE;
CWDAY/A4 = DOWK(CDATE, CWDAY);
END

TABLE FILE CAR
PRINT CDATE CWDAY
WHERE COUNTRY EQ 'ENGLAND'
WHERE CWDAY EQ 'SAT';
WHERE &CDAY GE 8 AND &CDAY LE 14
ON TABLE HOLD
END
-RUN

-SET &CNT=&LINES;
-SET &GOTO = IF &CNT GE 1 THEN ':yes' ELSE ':notyes';
-GOTO &GOTO

-:yes
-TYPE Second saturday
-GOTO :END

-:notyes
-TYPE Not Second saturday
-:END
-EXIT


7.7.03
 
Posts: 6 | Registered: September 26, 2012Report This Post
Expert
posted Hide Post
It should be a simple calc to get the day of week for the first day of the month and add 1 week + x days to it.

Something like this
DEFINE FUNCTION SCNDSAT/A8YYMD (SEEDDATE/A8YYMD)
 SEEDYYMD/YYMD = SEEDDATE ;
 CALC1/YYMD = DATEMOV(SEEDYYMD, 'BOM') ;
 DOW/W = CALC1 ;
FIX/I1 = IF DOW EQ 7 THEN 7 ELSE 0 ;
 CALC2/YYMD = CALC1  + (6 - DOW) + 7 + FIX ;
 SCNDSAT/A8YYMD = CALC2;
END

-RUN

-SET &TESTDATE = '20120101' ;
-SET &RES = SCNDSAT(&TESTDATE) ;

-TYPE &TESTDATE - &RES


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Try

-DEFAULTS &FIRSTMON=20121201                                     
DEFINE  FILE CAR                                                 
MYDATE/YYMD WITH COUNTRY = '&FIRSTMON' ;                         
DOW/I1 = MYDATE - (INT(MYDATE/7) * 7) ;                          
MYSAT2/YYMD = IF DOW LE 5 THEN MYDATE+12-DOW ELSE MYDATE+14+DOW ;
END                                                              
TABLE FILE CAR                                                   
PRINT MYDATE DOW MYSAT2                                          
IF RECORDLIMIT EQ 2                                              
END                                                              




e.g.

 
EX TEST FIRSTMON=20121201
 


for dec, 2012


IBI Development
 
Posts: 61 | Registered: November 15, 2005Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Waz:
It should be a simple calc to get the day of week for the first day of the month and add 1 week + x days to it.

Something like this
DEFINE FUNCTION SCNDSAT/A8YYMD (SEEDDATE/A8YYMD)
 SEEDYYMD/YYMD = SEEDDATE ;
 CALC1/YYMD = DATEMOV(SEEDYYMD, 'BOM') ;
 DOW/W = CALC1 ;
FIX/I1 = IF DOW EQ 7 THEN 7 ELSE 0 ;
 CALC2/YYMD = CALC1  + (6 - DOW) + 7 + FIX ;
 SCNDSAT/A8YYMD = CALC2;
END

-RUN

-SET &TESTDATE = '20120101' ;
-SET &RES = SCNDSAT(&TESTDATE) ;

-TYPE &TESTDATE - &RES


Thanks waz
Its working fine
One need a information
how to find the last run date report time , I'm not using Report Caster ,I'm running report manually


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 51 | Registered: December 01, 2010Report This Post
Expert
posted Hide Post
The simplest way to get the previous run would be to capture then run date each time the report is run, save it to a DB, FOCUS or other, then just TABLE to get the date/time.

This has been posted before in the forum.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Second Saturday of the Month

Copyright © 1996-2020 Information Builders