sudijana wrote:Now my requirement needs me to display the date even if no records are present corresponding to that date. Can you please tell me a workaround for this?
P.S. the batch job runs every Sunday(e.g. 08/03/09) and creates data for the previous week i.e Saturday(28/02/09) till Friday(06/03/09).
sudijana,
Use the following control cards. You can run the job on any day you want. It will still pick the date values from the previous week(sat thru friday).
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,
BUILD=(114C'0',48X,1,80,SEQNUM,1,ZD,RESTART=(1,3))),
IFTHEN=(WHEN=(243,1,ZD,EQ,1),OVERLAY=(001:167,7,043:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,2),OVERLAY=(008:167,7,055:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,3),OVERLAY=(015:167,7,067:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,4),OVERLAY=(022:167,7,079:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,5),OVERLAY=(029:167,7,091:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,6),OVERLAY=(036:167,7,103:175,12))
SORT FIELDS=(163,3,CH,A),EQUALS
SUM FIELDS=(001,07,008,07,015,07,022,07,029,07,036,07,
043,12,055,12,067,12,079,12,091,12,103,12),FORMAT=ZD
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(244:WKDAY)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'SUN'),
OVERLAY=(115:DATE1-08,DATE1-06,DATE1-05,DATE1-04,DATE1-3,DATE1-2)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'MON'),
OVERLAY=(115:DATE1-09,DATE1-07,DATE1-06,DATE1-05,DATE1-4,DATE1-3)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'TUE'),
OVERLAY=(115:DATE1-10,DATE1-08,DATE1-07,DATE1-06,DATE1-5,DATE1-4)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'WED'),
OVERLAY=(115:DATE1-11,DATE1-09,DATE1-08,DATE1-07,DATE1-6,DATE1-5)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'THU'),
OVERLAY=(115:DATE1-12,DATE1-10,DATE1-09,DATE1-08,DATE1-7,DATE1-6)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'FRI'),
OVERLAY=(115:DATE1-13,DATE1-11,DATE1-10,DATE1-09,DATE1-8,DATE1-7)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'SAT'),
OVERLAY=(115:DATE1-14,DATE1-12,DATE1-11,DATE1-10,DATE1-9,DATE1-8))
OUTFIL FNAMES=OUT1,REMOVECC,
BUILD=(163,3,5X,
001,07,ZD,M10,LENGTH=7,2X,08,07,ZD,M10,LENGTH=7,2X,
015,07,ZD,M10,LENGTH=7,2X,22,07,ZD,M10,LENGTH=7,2X,
029,07,ZD,M10,LENGTH=7,2X,36,07,ZD,M10,LENGTH=7,2X,
167,07,ZD,M10,LENGTH=7,80:X),
HEADER1=(10:' SALES INVOICE RECORDS BY DAY(RECORDS/DIV/DAY)',/,
10:' *********************************************',/,/,
01:'DIV',4X,119,4,115,4,X,127,4,123,4,X,135,4,131,4,X,
143,4,139,4,X,151,4,147,4,X,159,4,155,4,4X,'TOTAL',/,
01:3'*',4X,8'*',X,8'*',X,8'*',X,8'*',X,8'*',X,8'*',X,8'*'),
TRAILER1=(/,'TOTAL :',TOT=(001,07,ZD,M10,LENGTH=8),X,
TOT=(008,07,ZD,M10,LENGTH=8),X,
TOT=(015,07,ZD,M10,LENGTH=8),X,
TOT=(022,07,ZD,M10,LENGTH=8),X,
TOT=(029,07,ZD,M10,LENGTH=8),X,
TOT=(036,07,ZD,M10,LENGTH=8),X,
TOT=(167,07,ZD,M10,LENGTH=8))
OUTFIL FNAMES=OUT2,REMOVECC,
BUILD=(163,3,4X,
043,12,ZD,M10,LENGTH=12,X,055,12,ZD,M10,LENGTH=12,X,
067,12,ZD,M10,LENGTH=12,X,079,12,ZD,M10,LENGTH=12,X,
091,12,ZD,M10,LENGTH=12,X,103,12,ZD,M10,LENGTH=12,X,
175,12,ZD,M10,LENGTH=12,104:X),
HEADER1=(30:' SALES $ BY DAY(AMOUNT/DIV/DAY)',/,
30:' ******************************',/,/,
01:'DIV',8X,119,4,115,4,5X,127,4,123,4,5X,135,4,131,4,5X,
143,4,139,4,5X,151,4,147,4,5X,159,4,155,4,8X,'TOTAL',/,
01:3'*',8X,8'*',5X,8'*',5X,8'*',5X,8'*',5X,
8'*',5X,8'*',5X,8'*'),
TRAILER1=(/,'TOTAL :',TOT=(043,12,ZD,M10,LENGTH=12),X,
TOT=(055,12,ZD,M10,LENGTH=12),X,
TOT=(067,12,ZD,M10,LENGTH=12),X,
TOT=(079,12,ZD,M10,LENGTH=12),X,
TOT=(091,12,ZD,M10,LENGTH=12),X,
TOT=(103,12,ZD,M10,LENGTH=12),X,
TOT=(175,12,ZD,M10,LENGTH=12))
/*
INREC IFTHEN=(WHEN=INIT,
BUILD=(114C'0',48X,1,80,SEQNUM,1,ZD,RESTART=(1,3))),
IFTHEN=(WHEN=(243,1,ZD,EQ,1),OVERLAY=(001:167,7,043:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,2),OVERLAY=(008:167,7,055:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,3),OVERLAY=(015:167,7,067:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,4),OVERLAY=(022:167,7,079:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,5),OVERLAY=(029:167,7,091:175,12)),
IFTHEN=(WHEN=(243,1,ZD,EQ,6),OVERLAY=(036:167,7,103:175,12))
SORT FIELDS=(163,3,CH,A),EQUALS
SUM FIELDS=(001,07,008,07,015,07,022,07,029,07,036,07,
043,12,055,12,067,12,079,12,091,12,103,12),FORMAT=ZD
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(244:WKDAY)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'SUN'),
OVERLAY=(115:DATE1-08,DATE1-06,DATE1-05,DATE1-04,DATE1-3,DATE1-2)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'MON'),
OVERLAY=(115:DATE1-09,DATE1-07,DATE1-06,DATE1-05,DATE1-4,DATE1-3)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'TUE'),
OVERLAY=(115:DATE1-10,DATE1-08,DATE1-07,DATE1-06,DATE1-5,DATE1-4)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'WED'),
OVERLAY=(115:DATE1-11,DATE1-09,DATE1-08,DATE1-07,DATE1-6,DATE1-5)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'THU'),
OVERLAY=(115:DATE1-12,DATE1-10,DATE1-09,DATE1-08,DATE1-7,DATE1-6)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'FRI'),
OVERLAY=(115:DATE1-13,DATE1-11,DATE1-10,DATE1-09,DATE1-8,DATE1-7)),
IFTHEN=(WHEN=(244,3,CH,EQ,C'SAT'),
OVERLAY=(115:DATE1-14,DATE1-12,DATE1-11,DATE1-10,DATE1-9,DATE1-8))
OUTFIL FNAMES=OUT1,REMOVECC,
BUILD=(163,3,5X,
001,07,ZD,M10,LENGTH=7,2X,08,07,ZD,M10,LENGTH=7,2X,
015,07,ZD,M10,LENGTH=7,2X,22,07,ZD,M10,LENGTH=7,2X,
029,07,ZD,M10,LENGTH=7,2X,36,07,ZD,M10,LENGTH=7,2X,
167,07,ZD,M10,LENGTH=7,80:X),
HEADER1=(10:' SALES INVOICE RECORDS BY DAY(RECORDS/DIV/DAY)',/,
10:' *********************************************',/,/,
01:'DIV',4X,119,4,115,4,X,127,4,123,4,X,135,4,131,4,X,
143,4,139,4,X,151,4,147,4,X,159,4,155,4,4X,'TOTAL',/,
01:3'*',4X,8'*',X,8'*',X,8'*',X,8'*',X,8'*',X,8'*',X,8'*'),
TRAILER1=(/,'TOTAL :',TOT=(001,07,ZD,M10,LENGTH=8),X,
TOT=(008,07,ZD,M10,LENGTH=8),X,
TOT=(015,07,ZD,M10,LENGTH=8),X,
TOT=(022,07,ZD,M10,LENGTH=8),X,
TOT=(029,07,ZD,M10,LENGTH=8),X,
TOT=(036,07,ZD,M10,LENGTH=8),X,
TOT=(167,07,ZD,M10,LENGTH=8))
OUTFIL FNAMES=OUT2,REMOVECC,
BUILD=(163,3,4X,
043,12,ZD,M10,LENGTH=12,X,055,12,ZD,M10,LENGTH=12,X,
067,12,ZD,M10,LENGTH=12,X,079,12,ZD,M10,LENGTH=12,X,
091,12,ZD,M10,LENGTH=12,X,103,12,ZD,M10,LENGTH=12,X,
175,12,ZD,M10,LENGTH=12,104:X),
HEADER1=(30:' SALES $ BY DAY(AMOUNT/DIV/DAY)',/,
30:' ******************************',/,/,
01:'DIV',8X,119,4,115,4,5X,127,4,123,4,5X,135,4,131,4,5X,
143,4,139,4,5X,151,4,147,4,5X,159,4,155,4,8X,'TOTAL',/,
01:3'*',8X,8'*',5X,8'*',5X,8'*',5X,8'*',5X,
8'*',5X,8'*',5X,8'*'),
TRAILER1=(/,'TOTAL :',TOT=(043,12,ZD,M10,LENGTH=12),X,
TOT=(055,12,ZD,M10,LENGTH=12),X,
TOT=(067,12,ZD,M10,LENGTH=12),X,
TOT=(079,12,ZD,M10,LENGTH=12),X,
TOT=(091,12,ZD,M10,LENGTH=12),X,
TOT=(103,12,ZD,M10,LENGTH=12),X,
TOT=(175,12,ZD,M10,LENGTH=12))
/*