Description:
Use the CA Librarian -SCAN Utility control statement to scan the entire Master file for occurrences of a character string and the -SCANR Utility control statement to scan a specific range of modules in the Master file.
Solution:
First example will scan all members for character string (XYZ) in the default column range of 1-72:
//STEP1 EXEC PGM=AFOLIBR //MASTER DD DSN=YOUR.LIBRARIAN.MASTFILE,DISP=SHR //OSJOB DD DUMMY //LIST DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD * -OPT UTILITY -SEL NAME=, -SCAN *XYZ* -END //
Second example will scan a range of members for character string (12345) between columns 1 - 80:
//STEP1 EXEC PGM=AFOLIBR //MASTER DD DSN=YOUR.LIBRARIAN.MASTFILE,DISP=SHR //OSJOB DD DUMMY //LIST DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD * -OPT UTILITY -SCANR TEST,TEST3 -SCAN *12345*,STR=01,END=80 -END //
Please see the CA Librarian Batch Command Reference Guide for more information about the -SCAN and -SCANR Utility control statements.