//Jobnaem JOB ,,REGION=0M,CLASS=A,MSGCLASS=Z,
// NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SYMNAMES DD *
YR4,S'&YR4' -- Gives year 4 'YYYY'bytes
MON,S'&MON' -- Gives MONTH in number'01' for JAN and so on
//SORTIN DD *
[b]Q#YYYY_RECORD [/b]
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(3:YR4,16:MON)
OUTREC IFTHEN=(WHEN=(16,2,ZD,GE,1,&,16,2,ZD,LE,3),
OVERLAY=(2:C'1',16:2X)),
IFTHEN=(WHEN=(16,2,ZD,GE,4,&,16,2,ZD,LE,6),
OVERLAY=(2:C'2',16:2X)),
IFTHEN=(WHEN=(16,2,ZD,GE,7,&,16,2,ZD,LE,9),
OVERLAY=(2:C'3',16:2X)),
IFTHEN=(WHEN=(16,2,ZD,GE,10,&,16,2,ZD,LE,12),
OVERLAY=(2:C'4',16:2X))
/*
// NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SYMNAMES DD *
YR4,S'&YR4' -- Gives year 4 'YYYY'bytes
MON,S'&MON' -- Gives MONTH in number'01' for JAN and so on
//SORTIN DD *
[b]Q#YYYY_RECORD [/b]
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(3:YR4,16:MON)
OUTREC IFTHEN=(WHEN=(16,2,ZD,GE,1,&,16,2,ZD,LE,3),
OVERLAY=(2:C'1',16:2X)),
IFTHEN=(WHEN=(16,2,ZD,GE,4,&,16,2,ZD,LE,6),
OVERLAY=(2:C'2',16:2X)),
IFTHEN=(WHEN=(16,2,ZD,GE,7,&,16,2,ZD,LE,9),
OVERLAY=(2:C'3',16:2X)),
IFTHEN=(WHEN=(16,2,ZD,GE,10,&,16,2,ZD,LE,12),
OVERLAY=(2:C'4',16:2X))
/*
Output : (run on march 2015)
Q12015_RECORD
Code'd