Error checking and further actions (MODE Operator)


MODE operator controls the error checking and performs the actions after error detection. There are three modes available for error checking -

  • STOP mode (the default) stops subsequent operations if an error is detected.
  • CONTINUE mode continues with subsequent operations if an error is detected.
  • SCAN mode allows checking ICETOOL statements without performing any operations.

Syntax -

SCAN Mode -

 MODE SCAN
   RANGE ...
   UNIQUE ...

STOP Mode -

 MODE STOP
   VERIFY ...
   DISPLAY ...

CONTINUE Mode -

 MODE CONTINUE
   COPY ...
   SORT ...
   STATS ...

Required Operands


  • STOP - stops processing the remaining operations that are coded immediately to the STOP statement if an error occurs. However, it continues to check for errors in ICETOOL statements. It is the default mode set at the beginning of an ICETOOL run.
  • SCAN - checks for errors in ICETOOL statements without processing the operations. It is set automatically when an error is detected in STOP mode.
  • CONTINUE - processes the remaining operations that are coded immediately to the CONTINUE even an error occurs.

Example -


Scenario - Separate employee details based on "IN", "US". If any error occurs in the first processing stops the second process.

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        IN
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
//OUTDD1   DD DSN=MATEPK.OUTPUT.PSFILEM1,
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD4,
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//OUTDD2   DD DSN=MATEPK.OUTPUT.PSFILEM2,
//            DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD4,
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//TOOLIN   DD * 
  COPY  FROM(INDD) TO(OUTDD1) USING(CTL1)
  MODE  STOP
  COPY  FROM(INDD) TO(OUTDD2) USING(CTL2)
/*
//CTL1CNTL DD * 
  INCLUDE COND=(60,2,CH,EQ,C'IN') 
/* 
//CTL2CNTL DD *
  INCLUDE COND=(60,2,CH,EQ,C'US')
/*
...

OUTPUT1 - MATEPK.OUTPUT.PSFILEM1

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
001  PAWAN         MAINFRAME           JPM       AP        IN
002  SRINIVAS      TESTING             ORACLE    TG        IN
004  VENKATESH     ABAP                CSC       CA        IN

OUTPUT2 - MATEPK.OUTPUT.PSFILEM2

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
003  SRIDHAR       SAS                 CG        OR        US
005  RAVI          HADOOP              CTS       FL        US
006  PRASAD        HR                  INFOSYS   MI        US
007  RAJA          TESTING             IBM       CA        US