FDREPORT IF Statement


IF statement

The IF statement provides a different means of selection and exclusion of data to be processed by FDREPORT. The IF statements are complied as they are read and stored for use by the standard XSELECT and XEXCLUDE process. Since the statements are complied in this manner, it is possible to perform field to field direct compares as well as field to constant or constant to field compares.

Important

Limited support is currently available for compound IF statements. When possible, continue to use the XSELECT and XEXCLUDE statements.

IF statement syntax

IF

variable operator variable


THEN(action)

The simplest form of the IF command can be represented as:


IF CRDATE = LRDATE THEN(SELECT) IF field_name operator constant AND + field_name operator constant AND + field_name operator constant THEN(action) IF (field_name operator constant) AND + (field_name operator constant) OR + (field_name operator constant) THEN(action)

An example of the use of the IF statement to quickly scan the DASD volumes that are at least 365 days old, have at least one track allocated, and have not been referenced since the day they were created, excluding the ABR Model DSCB’s, VTOC’s, and indexed VTOC’s from this list:

IF (DSN¬='****VTOC' AND DSN¬='***ABR' AND + DSN¬='SYS1.VTOC' AND LRDAYS>365 AND + CRDATE=LRDATE AND SIZE>0) THEN(SELECT) REPORT FIELDS=(DSN,VOL,CRDATE,LRDATE,CRDAYS,LRDAYS,SIZE) SORT FIELDS=(INDEX,CLUSTER,DSN),BREAK=SUB SUMMARY FIELDS=(DSN,SIZE) PRINT SORTALLOCATE=YES,ENABLE=ONLINE

You may want to omit some standard data set entries that exist on all volumes or are part of the system. Prior to the addition of the IF command, the only method to do this was with a series of XEXCLUDE statements.


XEXCLUDE DSN=****VTOC ** Exclude VTOC's XEXCLUDE XDSN=SYS1.VTOCIX.** ** Exclude VTOC Indexes XEXCLUDE XDSN=SYS1.VVDS.** ** Exclude VVDS's XEXCLUDE XDSN=SYS+++++.** ** Exclude Temporary data sets XEXCLUDE DSG=***ABR ** Exclude ABR Model DSCB's XEXCLUDE SIZE=0 ** Exclude Model DSCB's XEXCLUDE XDSN=**CATINDEX** ** Exclude Catalog Indexes XEXCLUDE OPTCD=BC ** Exclude ICF Catalogs

The IF statement can also be used to perform this exclusion using the “EXCLUDE” action on the IF statement.

IF DSN='****VTOC' THEN(EXCLUDE) IF DSN='SYS1.VTOCIX' THEN(EXCLUDE) IF DSN='SYS1.VVDS' THEN(EXCLUDE) IF DSN='SYS+++++' THEN(EXCLUDE) IF DSN='***ABR MODEL' THEN(EXCLUDE) IF SIZE=0 THEN(EXCLUDE) IF DSN='**CATINDEX**' THEN(EXCLUDE) IF OPTCD=BC THEN(EXCLUDE)

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*