How do I Scan a Librarian Master File for a string of data in a range of members or all members?

Document ID : KB000019518
Last Modified Date : 14/02/2018
Show Technical Document Details

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.