I have a requirement where in i have to read a VsAm file and inlcude records based on the date value, here the date format in the VSAM file comp3.
I have created the sort statements using the below JCL and fulfilled my requirement :
//SETP002 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXXXXX.DATE.FILE,DISP=SHR
//SORTOUT DD DSN=XXXXXX.SRTCARD2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(*.SORTIN)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(3:C'INCLUDE COND=(235,05,PD,EQ,',
30:1,8,38:X'5D',42X)
/*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXXXXX.DATE.FILE,DISP=SHR
//SORTOUT DD DSN=XXXXXX.SRTCARD2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(*.SORTIN)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(3:C'INCLUDE COND=(235,05,PD,EQ,',
30:1,8,38:X'5D',42X)
/*
But i searched for an alternative using the SYMNAMES concept :
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
PICKDATE,S'&YR4-&LMON-&LDAY'
//SORTIN DD DSN=Input file,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(235,05,PD,EQ,PICKDATE)
SORT FIELDS=COPY
/*
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
PICKDATE,S'&YR4-&LMON-&LDAY'
//SORTIN DD DSN=Input file,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(235,05,PD,EQ,PICKDATE)
SORT FIELDS=COPY
/*
But my job got failed as Pick date is getting replaced with charcater '2013-07-06' instead of 2013-07-06(Zonal Decimal) . This will work best when my date in VSAm file is a charcter .
Below is the error code :
SYNCSORT FOR Z/OS 1.4.1.0N
SYSIN :
INCLUDE COND=(235,05,PD,EQ,PICKDATE)
SORT FIELDS=COPY
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INCLUDE COND=(235,05,PD,EQ,C'2013-07-06')
*
SORT FIELDS=COPY
WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
SYSIN :
INCLUDE COND=(235,05,PD,EQ,PICKDATE)
SORT FIELDS=COPY
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INCLUDE COND=(235,05,PD,EQ,C'2013-07-06')
*
SORT FIELDS=COPY
WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Can any one suggest a way to get the date parameter in the Include condition dynamically as Zonal decimal ?
Thanks for your time
Nara