I have a dataset in which the dates are in PD format (Col 19). What I am trying to achieve is. I want to get the MIN and MAX Date from huge dataset. I created a JCL with which I was able to achieve this.
//**********************************************************************
//*GET MAX AND MIN FOR DATE
//**********************************************************************
//STEP1 EXEC PGM=SORT,REGION=0M
//SORTIN DD DISP=SHR,DSN=TEST.INPUT
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(19,4,CH,A)
OUTFIL NODETAIL,REMOVECC,
TRAILER2=('DATE: ',
MIN=(19,4,PD,TO=ZD),' - ',MAX=(19,4,PD,TO=ZD))
//*GET MAX AND MIN FOR DATE
//**********************************************************************
//STEP1 EXEC PGM=SORT,REGION=0M
//SORTIN DD DISP=SHR,DSN=TEST.INPUT
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(19,4,CH,A)
OUTFIL NODETAIL,REMOVECC,
TRAILER2=('DATE: ',
MIN=(19,4,PD,TO=ZD),' - ',MAX=(19,4,PD,TO=ZD))
The output of this JCL is in Format:
DATE: 2012044 - 2012296
I have been looking over various forums but could not find a way to convert this julian date to Gregorian Date Format (MM/DD/CCYYY)
Is there a way to further tweak parameters of MIN/MAX to reformat the dates. I know another way to convert the date, but I am not sure how they can be integrated in one.
INREC BUILD=(19,4,Y4T,TOGREG=Y2T)
Please pour in your suggestions and point out, if my approach is incorrect.
Thanks.