Counting values in a range

You can use ICETOOL's RANGE operator to count the number of values for a particular numeric field that fall within a range you define. The range can be defined with:
Operand
Comparison
EQUAL (u)
Equal to u
NOTEQUAL (v)
Not equal to v
LOWER (w)
Less than w
HIGHER (x)
Greater than x
HIGHER (x) and LOWER (w)
Greater than x, but less than w
To print a count of the number of California branches with profit greater than -1500, but less than +8000, write the following RANGE statement: Printing a count of the number of California branches with profit greater than −1500, but less than +8000

The input data set defined by CADASD is the same data set you created earlier (with the SORT operator) for the California branches. HIGHER(-1500) indicates that you want to count values in the profit field that are greater than -1500, while LOWER(+8000) indicates that you want to count values in the profit field that are less than +8000. For a negative limit, you must specify a minus (-) sign before the number. For a positive limit, you either specify a plus (+) sign before the number or leave it out, therefore, HIGHER(8000) is the same as HIGHER(+8000).

To print a count of the number of branches (in California and Colorado) with less than 32 employees, write the following RANGE statement: Printing a count of the number of branches (in California and Colorado) with less than 32 employees

Because CADASD and ALL were previously defined, you don't need to add any new JCL statements to the ICETOOL job.

When these RANGE operators are run, the results are placed in the TOOLMSG data set. The TOOLMSG output produced for these RANGE operators would look like this:

           * California branches profit analysis
             RANGE FROM(CADASD) ON(28,6,PD) HIGHER(-1500)  LOWER(+8000)
 ICE627I 0 DFSORT CALL 0004 FOR COPY FROM CADASD   TO E35  EXIT COMPLETED
 ICE628I 0 RECORD COUNT:  000000000000007
 ICE631I 0 NUMBER OF VALUES IN RANGE FOR (28,6,PD)     :   000000000000003
 ICE602I 0 OPERATION RETURN CODE:  00

           * Branches with less than 32 employees
             RANGE FROM(ALL) ON(18,4,ZD) LOWER(32)
 ICE627I 0 DFSORT CALL 0005 FOR COPY FROM ALL      TO E35  EXIT COMPLETED
 ICE628I 0 RECORD COUNT:  000000000000012
 ICE631I 0 NUMBER OF VALUES IN RANGE FOR (18,4,ZD)     :   000000000000008
 ICE602I 0 OPERATION RETURN CODE:  00
Looking at the output, you will notice that:
So far
You have now learned how to count the number of values in a range for a particular field using ICETOOL's RANGE operator. Next, you will learn about ICETOOL's DISPLAY operator.