Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Second Saturday of the Month
Go
New
Search
Notify
Tools
Reply
  
[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, 2010Reply With QuoteReport 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, 2012Reply With QuoteReport 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.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6270 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport 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: 60 | Registered: November 15, 2005Reply With QuoteReport 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, 2010Reply With QuoteReport 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.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

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

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

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.