Previous Topic: SCAN and FIND Rule #2Next Topic: SCAN and FIND Rule #4


SCAN and FIND Rule #3

SELECT and/or EXCLUDE commands apply to all action commands that follow, until either a non-consecutive SELECT or EXCLUDE command is encountered, or until a SCAN or FIND command is encountered.

You can apply the preceding rule to one or more selection tests for multiple action commands. In the following example, the two catalogs named will be scanned and all data sets that meet either SELECT test will be both backed up and reported on:

SCAN CATALOGS=VOL05.USERCAT
SCAN CATALOGS=VOL00.USERCAT
SELECT CRITERIA=(TRKS,GT,30),DSN=/
SELECT CRITERIA=(ARCDT,LE,TODAY-30),DSN=/
BACKUP
REPORT MAPPER,CLDATA,SVDICT

In the following example, both catalogs will be scanned and those data sets that have not been modified within the last year will be archived. In addition, those data sets that use less than 25 percent of their allocated space will be reported on. Note that because the two SELECT commands are not consecutive, the first SELECT command has no effect on the ARCHIVE command. However, a data set can be selected by both action commands if it met both selection criteria:

SCAN CATALOGS=VOL05.USERCAT
SCAN CATALOGS=VOL00.USERCAT
SELECT CRITERIA=(PCTUSED,LT,25),DSN=/
REPORT MVDICT
SELECT CRITERIA=(MODDT,LT,TODAY-36),DSN=/
ARCHIVE

You can also combine FIND commands with SELECT and/or EXCLUDE commands:

FIND DSNAMES=LABS.TJP.VSAMFIL
FIND DSNAMES=LABS.DMS.VSAM/
SELECT CRITERIA=(TRKS,GT,20),DSN=/
EXCLUDE DSNAMES=LABS.DMS.VSAMP/
ARCHIVE