The Boolean logic support of the CRITERIA parameter is invoked by specifying either an AND or an OR between conditional tests. Remember that a conditional test consists of an operand, an operator, and a second operand. You can specify a maximum of 64 conditional tests on a single CRITERIA parameter when each is separated by a compound condition (note that the maximum allowed can be affected by sysparm VSCRIMAX). Therefore, a valid Boolean test would be:
SELECT CRITERIA=(TRKS,GT,300,AND,PCTUSED,LT,80,AND,CREDT,GT,TODAY-60)
As in the example previous, if all of the compound conditions are AND, all of the conditional tests specified must be true for the statement to be true. Therefore, the data set would have to be larger than 300 tracks AND be less than 80 percent used AND have a creation date within the last 60 days to meet the criteria. Conversely, if all of the compound conditions are OR, if any of the conditional tests are true, the statement is true.
If both AND OR compound conditions are specified on a single command, all AND conditions are logically separated by each OR. In other words, if all AND conditions are true and an OR condition is encountered, the statement is considered true. To better describe the tests involved, let's look at a few examples.
SELECT CRITERIA=(TRKS,GT,300,AND,PCTUSED,LT,65,
OR,TRKS,LE,300,AND,PCTUSED,LT,50)
SELECT CRITERIA=(TRKS,GT,50,AND,EXPDT,LT,TODAY,AND,
EXPDT,NE,0, OR,
TRKS,GT,50,AND,MODDT,LT,TODAY-90)
Remember that in DSCL, neither indentation nor line breaks are important to the command parser, but they can be used to make the meaning clearer to users.
Note: In this example, the TRKS,GT,50 test was specified on both sides of the OR condition. This is necessary because the OR condition logically separates the AND conditions. See what happens when the second TRKS,GT,50 test is removed:
SELECT CRITERIA=(TRKS,GT,50,AND,EXPDT,LT,TODAY,AND,
EXPDT,NE,0,
OR,
MODDT,LT,TODAY-90)
With this test, data sets will be selected if:
Note: The second test now makes no comparisons for track size and will be selected regardless of its size if the modification date test is true.
SELECT CRITERIA=(TRKS,GT,400)
SELECT CRITERIA=(CREDT,GT,1/9/1996)
SELECT CRITERIA=(MODDT,LT,TODAY-365)
SELECT CRITERIA=(TRKS,GT,300,AND,MODDT,LT,TODAY-60)
SELECT CRITERIA=(USEDT,EQ,0,OR,
USEDT,LT,TODAY-365)
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|