Displays value count between range (RANGE Operator) Example


Scenario -Display 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----+
//MATEPKR  JOB (123),'MATEPK',CLASS=A,MSGCLASS=A,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//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  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//

TOOLMSG (SDSF SPOOL) - Verify TOOLMSG for the return code of the submitted job.

RANGE TOOLMSG

Explaining Example -

  • INDD - Specifies the ddname for input file.
  • TOOLIN DD * - Specifies the ICETOOL statements for DFSORT.
  • TOOLMSG - Specifies where to write the ICETOOL processing messages.
  • DFSMSG - Specifies where to write the DFSORT processing messages.
  • COPY FROM(INDD) TO(OUTDD) - Copies all the records from INDD file to OUTDD file.
  • RANGE FROM(INDD) ON(1,3,ZD) HIGHER(2) LOWER(6) - Writes the count of the records in between the higher and lower values specified based on the selection criteria.