Previous Topic: SCAN and FIND Rule #3Next Topic: SCAN and FIND Rule #5


SCAN and FIND Rule #4

Any ACTION command applies to all SCAN and/or FIND commands in the current SCAN/FIND group.

This rule has already been demonstrated in previous examples. Whenever an action command is entered, the easiest way to determine which volume(s), catalog(s) and/or data set name(s) it will be processed against is to look up in the command stream and find the first SCAN or FIND command that precedes it. The real volumes, catalog, or data set name on that command, plus any others named on preceding consecutive SCAN and/or FIND command(s), will be affected by that ACTION command.

The examples have shown command input with only one SCAN/FIND group. Now let's look at an example with four SCAN/FIND groups. Remember that a SCAN/FIND group is detected by the presence of a non-consecutive SCAN or FIND command. In this example we scan all real volumes and all ICF and VSAM (but not OS CVOL) catalogs and report on all data sets created before January 16, 1996. In addition, another catalog is scanned to archive VSAM data sets that have not been modified in the last 30 days, but no report is needed for that catalog.

The final catalog is scanned and all data sets are reported on.

SCAN REALVOLS
SELECT CRITERIA=(CREDT,LT,1/16/96),DSN=/
REPORT MVDICT
SCAN CATALOGS=/
SELECT CRITERIA=(CREDT,LT,1/16/96),DSN=/
REPORT MVDICT
SCAN CATALOGS=VOL00.TESTCAT
SELECT CRITERIA=(MODDT,LT,TODAY-30),DSN=/
ARCHIVE
SCAN CATALOGS=DMS.PRODUCT.CATALOG
SELECT DSN=/
REPORT CLDATA,CLDOPT=DIBEBBAC