-SET &&LDATE = 01011900;
-IF &&CHGDATE IS 'Y' GOTO RPTDATE;
-SET &TIMENOW = HHMMSS ('A8');
-SET &CHCKHH = EDIT (&TIMENOW,'99$$$$$$');
-*
-RPTDATE
-*
-SET &DAY1 = EDIT(&YMD,'$$$$99');
-SET &MON1 = EDIT(&YMD,'$$99$$');
-SET &YER1 = EDIT(&YMD,'99$$$$');
-SET &CNT1 = IF &YER1 LT '90' THEN '20' ELSE '19';
-SET &FULLYR = &CNT1 | &YER1;
-SET &LASTYR = (&FULLYR - 1);
-SET &ALASTYR = EDIT(&LASTYR,'$$99');
-SET &LASTMO = DECODE &MON1 ('01' '12' '02' '01' '03' '02'
- '04' '03' '05' '04' '06' '05'
- '07' '06' '08' '07' '09' '08'
- '10' '09' '11' '10' '12' '11');
-SET &LASTMO2= DECODE &MON1 ('01' '11' '02' '12' '03' '01'
-SET &LASTYR2=&LASTYR - 1;
-SET &&CYBEG = '0101' | &FULLYR;
-SET &&PYBEG = '0101' | &LASTYR;
-SET &&PYEND = '1231' | &LASTYR;
-SET &&PYEND2 = '1231' | &LASTYR2;
-SET &&CFYBEG = '1001' | &LASTYR;
-SET &&CFYEND = '0930' | &FULLYR;
-SET &&PFYBEG = '1001' | &LASTYR2;
-SET &&PFYEND = '0930' | &LASTYR;
-SET &&CFY = &FULLYR;
-SET &&PFY = &LASTYR;
-SET &&NXFY = &NXTYR;
-SET &&NXFYBEG = '1001' | &FULLYR;
-SET &&NXFYEND = '0930' | &NXTYR;
-*
-SET &&NEXTYR= &MON1 | &DAY1NX | &NXTYR;
-SET &&NEXTYR5= &MON1 | &DAY1NX5 | &NXTYR5;
-SET &&NEXTYR10= &MON1 | &DAY1NX10 | &NXTYR10;
-***
-*
-SET &&CQTR = DECODE &MON1 ('01' '01' '02' '01' '03' '01'
- '04' '02' '05' '02' '06' '02'
- '07' '03' '08' '03' '09' '03'
- '10' '04' '11' '04' '12' '04');
-SET &CQBEG1 = DECODE &&CQTR ('01' '0101' '02' '0401'
- '03' '0701' '04' '1001');
-SET &&CQBEG = &CQBEG1 | &FULLYR;
-SET &CQEND1 = DECODE &&CQTR ('01' '0331' '02' '0630'
- '03' '0930' '04' '1231');
-SET &&CQEND = &CQEND1 | &FULLYR;
-*
-SET &&PQTR = DECODE &MON1 ('01' '04' '02' '04' '03' '04'
- '04' '01' '05' '01' '06' '01'
- '07' '02' '08' '02' '09' '02'
- '10' '03' '11' '03' '12' '03');
-SET &PQBEG1 = DECODE &&PQTR ('01' '0101' '02' '0401'
- '03' '0701' '04' '1001');
-SET &PQEND1 = DECODE &&PQTR ('01' '0331' '02' '0630'
- '03' '0930' '04' '1231');
-SET &PREVYR = IF &&PQTR IS '04' THEN &LASTYR ELSE &FULLYR;
-SET &&PQBEG = &PQBEG1 | &PREVYR;
-SET &&PQEND = &PQEND1 | &PREVYR;
-*
-*
-SET &&PQTR2 = DECODE &MON1 ('01' '03' '02' '03' '03' '03'
- '04' '04' '05' '04' '06' '04'
- '07' '01' '08' '01' '09' '01'
- '10' '02' '11' '02' '12' '02');
-SET &PQBEG2A= DECODE &&PQTR2 ('01' '0101' '02' '0401'
- '03' '0701' '04' '1001');
-SET &PQEND2A= DECODE &&PQTR2 ('01' '0331' '02' '0630'
- '03' '0930' '04' '1231');
-SET &PREVYR2 = IF &&PQTR2 IS '04' THEN &LASTYR ELSE
- IF &&PQTR IS '04' THEN &LASTYR ELSE
- &FULLYR;
-SET &&PQBEG2 = &PQBEG2A | &PREVYR2;
-SET &&PQEND2 = &PQEND2A | &PREVYR2;
-*
-*
-*
-SET &&PQTR3 = DECODE &MON1 ('01' '02' '02' '02' '03' '02'
- '04' '03' '05' '03' '06' '03'
- '07' '04' '08' '04' '09' '04'
- '10' '01' '11' '01' '12' '01');
-SET &PQBEG3A = DECODE &&PQTR3 ('01' '0101' '02' '0401'
- '03' '0701' '04' '1001');
-SET &PQEND3A = DECODE &&PQTR3 ('01' '0331' '02' '0630'
- '03' '0930' '04' '1231');
-SET &PREVYR3 = IF &&PQTR3 IS '04' THEN &LASTYR ELSE
- IF &&PQTR2 IS '04' THEN &LASTYR ELSE
- IF &&PQTR IS '04' THEN &LASTYR ELSE
- &FULLYR;
-SET &&PQBEG3 = &PQBEG3A | &PREVYR3;
-SET &&PQEND3 = &PQEND3A | &PREVYR3;
-*
-*
-SET &&PQTR4 = DECODE &MON1 ('01' '01' '02' '01' '03' '01'
- '04' '02' '05' '02' '06' '02'
- '07' '03' '08' '03' '09' '03'
- '10' '04' '11' '04' '12' '04');
-SET &PQBEG4A = DECODE &&PQTR4 ('01' '0101' '02' '0401'
- '03' '0701' '04' '1001');
-SET &PQEND4A = DECODE &&PQTR4 ('01' '0331' '02' '0630'
- '03' '0930' '04' '1231');
-SET &PREVYR4 = IF &&PQTR4 IS '04' THEN &LASTYR ELSE
- IF &&PQTR3 IS '04' THEN &LASTYR ELSE
- IF &&PQTR2 IS '04' THEN &LASTYR ELSE
- IF &&PQTR IS '04' THEN &LASTYR ELSE
- &FULLYR;
-SET &&PQBEG4 = &PQBEG4A | &PREVYR4;
-SET &&PQEND4 = &PQEND4A | &PREVYR4;
-*
-*
-*
-SET &&PQTR5 = DECODE &MON1 ('01' '04' '02' '04' '03' '04'
- '04' '01' '05' '01' '06' '01'
- '07' '02' '08' '02' '09' '02'
- '10' '03' '11' '03' '12' '03');
-SET &PQBEG5A = DECODE &&PQTR5 ('01' '0101' '02' '0401'
- '03' '0701' '04' '1001');
-SET &PQEND5A = DECODE &&PQTR5 ('01' '0331' '02' '0630'
- '03' '0930' '04' '1231');
-SET &PREVYR5 = IF &&PQTR5 IS '04' THEN &LASTYR2 ELSE &LASTYR;
-SET &&PQBEG5 = &PQBEG5A | &PREVYR5;
-SET &&PQEND5 = &PQEND5A | &PREVYR5;
-*
-*
-*
WebFOCUS 8
Windows, All Outputs