I'm trying to generate 3 files with the last level name as a date.
The first file must be the system date, the second the system date - 1 and the third the system date - 2.
THE CODE
//SORTIN DD *
20100102
//FECHOY DD DSN=&FECHOY,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//FECMEN1 DD DSN=&FECMEN1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//FECMEN2 DD DSN=&FECMEN2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//FECMEN4 DD DSN=DES.FI.LR.BDK.FECMEN4,
// DISP=(,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80)
//SYSOUT DD SYSOUT=*
SORT FIELDS=COPY
INREC IFOUTLEN=90,
IFTHEN=(WHEN=INIT,OVERLAY=(50:1,8,Y4T,TOJUL=Y4T,
60:50,4,54,3,ZD,SUB,+1,M11,LENGTH=3,
70:50,4,54,3,ZD,SUB,+2,M11,LENGTH=3)),
IFTHEN=(WHEN=(64,3,ZD,EQ,0),
OVERLAY=(20:60,4,ZD,SUB,+1,M11,LENGTH=4,C'1231')),
IFTHEN=(WHEN=(64,3,ZD,GT,0),
OVERLAY=(20:60,7,Y4T,TOGREG=Y4T)),
IFTHEN=(WHEN=(74,3,ZD,EQ,0),
OVERLAY=(30:70,4,ZD,SUB,+1,M11,LENGTH=4,C'1231')),
IFTHEN=(WHEN=(74,3,ZD,GT,0),
OVERLAY=(30:70,7,Y4T,TOGREG=Y4T))
OUTFIL FNAMES=FECHOY,
BUILD=(C' LISTC ENT(''EXA7.GM.LR.BDK.GMJDTM3.F',03,06,C''')',80:X)
OUTFIL FNAMES=FECMEN1,
BUILD=(C' LISTC ENT(''EXA7.GM.LR.BDK.GMJDTM3.F',22,06,C''')',80:X)
OUTFIL FNAMES=FECMEN2,
BUILD=(C' LISTC ENT(''EXA7.GM.LR.BDK.GMJDTM3.F',32,06,C''')',80:X)
20100102
//FECHOY DD DSN=&FECHOY,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//FECMEN1 DD DSN=&FECMEN1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//FECMEN2 DD DSN=&FECMEN2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//FECMEN4 DD DSN=DES.FI.LR.BDK.FECMEN4,
// DISP=(,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80)
//SYSOUT DD SYSOUT=*
SORT FIELDS=COPY
INREC IFOUTLEN=90,
IFTHEN=(WHEN=INIT,OVERLAY=(50:1,8,Y4T,TOJUL=Y4T,
60:50,4,54,3,ZD,SUB,+1,M11,LENGTH=3,
70:50,4,54,3,ZD,SUB,+2,M11,LENGTH=3)),
IFTHEN=(WHEN=(64,3,ZD,EQ,0),
OVERLAY=(20:60,4,ZD,SUB,+1,M11,LENGTH=4,C'1231')),
IFTHEN=(WHEN=(64,3,ZD,GT,0),
OVERLAY=(20:60,7,Y4T,TOGREG=Y4T)),
IFTHEN=(WHEN=(74,3,ZD,EQ,0),
OVERLAY=(30:70,4,ZD,SUB,+1,M11,LENGTH=4,C'1231')),
IFTHEN=(WHEN=(74,3,ZD,GT,0),
OVERLAY=(30:70,7,Y4T,TOGREG=Y4T))
OUTFIL FNAMES=FECHOY,
BUILD=(C' LISTC ENT(''EXA7.GM.LR.BDK.GMJDTM3.F',03,06,C''')',80:X)
OUTFIL FNAMES=FECMEN1,
BUILD=(C' LISTC ENT(''EXA7.GM.LR.BDK.GMJDTM3.F',22,06,C''')',80:X)
OUTFIL FNAMES=FECMEN2,
BUILD=(C' LISTC ENT(''EXA7.GM.LR.BDK.GMJDTM3.F',32,06,C''')',80:X)
The results
LISTC ENT('EXA7.GM.LR.BDK.GMJDTM3.F100102')
LISTC ENT('EXA7.GM.LR.BDK.GMJDTM3.F100101')
LISTC ENT('EXA7.GM.LR.BDK.GMJDTM3.F ')
LISTC ENT('EXA7.GM.LR.BDK.GMJDTM3.F100101')
LISTC ENT('EXA7.GM.LR.BDK.GMJDTM3.F ')
The last file dn't have the date 091231 as I espect, and I don't know whay. Please can someone help me?
Thanks.