My requirement is, I need to search for a string in all GDG generations(appx 100).
The string is at a specific position.
Is there a way that the search should start from (Latest Gen - 1) up to oldest generation present ???
Is there a way I can get the Generation name in which the string is present ???
I have a working code which searches from the latest gen to oldest gen, and copies the records corresponding to the string to output file.
But I can't know in which gen it's present.
//STEP1 EXEC PGM=SYNCSORT
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=MY-GDG-BASE,
// DISP=SHR
//FILE1 DD DSN=OUTPUT-FILE-HAVING-RECS-WITH-MY-STRING,
// DISP=(NEW,CATLG,DELETE),
// DCB=*.SORTIN,
// SPACE=(CYL,(3,300))
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1,INCLUDE=((8,9,CH,EQ,C'MY-STRING1'),OR,
(8,9,CH,EQ,C'MY-STRING2'),OR,
(8,9,CH,EQ,C'MY-STRING3'))
/*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=MY-GDG-BASE,
// DISP=SHR
//FILE1 DD DSN=OUTPUT-FILE-HAVING-RECS-WITH-MY-STRING,
// DISP=(NEW,CATLG,DELETE),
// DCB=*.SORTIN,
// SPACE=(CYL,(3,300))
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1,INCLUDE=((8,9,CH,EQ,C'MY-STRING1'),OR,
(8,9,CH,EQ,C'MY-STRING2'),OR,
(8,9,CH,EQ,C'MY-STRING3'))
/*