RANGE Operator
Displays value count between range (RANGE Operator)
RANGE operator displays the count of values that are in between the coded range for a field. The count message always prints in the TOOLMSG dataset.
Syntax -
Required Operands
- FROM - specifies ddname of the input file. It is mandatory when FROM operand is coded.
- LIST - specifies the list dataset ddname to be created by ICETOOL LIST operation. A listdd DD statement should be provided.
- ON (p,l,f) - specifies the field(s) used for validation.
- p - gives the starting position of field.
- l - gives the length of the field. The field should not be beyond position 32752 or the end of the record.
- f - gives the format of the data. The valid formats are PD(Signed Packed decimal - 1 to 16 bytes) and ZD (Signed Zoned decimal - 1 to 31 bytes).
- HIGHER (x), LOWER (y), EQUAL (v), NOTEQUAL (w) - Sets RC=0 if the record count satisfies the given condition. Sets RC=12 (or RC=8 when RC8 is specified, or RC=4 when RC4 is specified) if the record count is higher than x. x, y, v, and w should be specified as n, +n, or -n where n can be 1 to 31 digits. x, y, v and w values can be in between 0 to 562949953421310.
Optional Operands
- VSAMTYPE - specifies the record format for a VSAM input file. It should be either F (fixed-length) or V (variable-length) record processing.
Example -
Scenario - Displays the active employees count in between 2 and 6.
INPUT - MATEPK.INPUT.PSFILE
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
001 PAWAN MAINFRAME JPM AP IN
002 SRINIVAS TESTING ORACLE TG IN
003 SRIDHAR SAS CG OR US
004 VENKATESH ABAP CSC CA US
005 RAVI HADOOP CTS FL US
006 PRASAD HR INFOSYS MI US
007 RAJA TESTING IBM CA US
JCL -
----+----1----+----2----+----3----+----4----+----5----+
...
//STEP01 EXEC PGM=ICETOOL
//INDD DD DSN=MATEPK.INPUT.PSFILE,DISP=SHR
//TOOLIN DD *
RANGE FROM(INDD) ON(1,3,ZD) HIGHER(2) LOWER(6)
/*
...
TOOLMSG (SDSF SPOOL) - Verify TOOLMSG for the return code of the submitted job.