In our daily work, we often use the SRCHFOR command interactively to search for specific text within members of a PDS. For batch processing, IBM provides the ISRSUPC utility, which serves as the batch equivalent of the interactive SuperC search.
When using PARM=(SRCHCMP,'ANYC'), the utility performs a case-insensitive search across dataset members. Here’s what the parameters mean:
SRCHCMP: Activates search mode instead of comparison mode, enabling the use ofSRCHFORstatements.ANYC: Stands for “Any Case”, allowing matches regardless of letter casing (e.g.,error,ERROR,Errorwill all match).
🧾 Sample JCL
//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')
//NEWDD DD DSN=TEST.JCL,DISP=SHR
//OUTDD DD DSN=TEST.OUTPUT.SRCH2,DISP=(NEW,CATLG,DELETE),
// SPACE=(133,(5,5)),
// DCB=(LRECL=133,BLKSIZE=133,RECFM=FB)
//SYSIN DD *
SRCHFOR 'TEXT STRING'
SRCHFOR 'TEXT STRING2'
/*
//STEP02 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SORTIN DD DSN=TEST.OUTPUT.SRCH2,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(30,6,CH,EQ,C' -----')
OUTREC FIELDS=(1,8)
/*
📄 Explanation of SORT Step
The second step uses DFSORT to scan the output file generated by ISRSUPC. It filters lines containing ' -----' starting at column 30 (often used to mark member headers in SuperC output) and extracts the first 8 characters—typically the member names.
If you want to save the extracted member names to a dataset instead of printing to spool, simply replace SYSOUT=* in SORTOUT with a dataset definition.
Leave a comment