ICETOOL - MODE Operator


Check errors and specifying actions to be performed after error detection for a group of operators.

Three modes are available to set or reset for group of operators -

  • 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 to check ICETOOL statement without performing any operations.

A MODE operator affects the processing of operators group up to the next MODE operator.

MODE STOP groups the dependent operators.

MODE CONTINUE groups independent operators.

MODE SCAN groups the Operators that are to be checked for errors only.


Syntax: -



Required Operand: -


STOP -

Stops processing the remaining operators in the group immediate to the STOP statement if an operation fails.

But it continues to check for errors in ICETOOL statements.

STOP mode is the default mode sets at the beginning of an ICETOOL run.


CONTINUE -

Continue processing the remaining operators in the group if an operation fails.


SCAN -

Checks for errors in ICETOOL statements without processing the operators.

Set automatically if an error is detected while in STOP mode.


Example: -

Below example to sperate the employee records based on the country code to output dataset.


Input: -

MTHUSR.INPUT.DATASET -


JCL: -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MTHUSRR JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),         
//             NOTIFY=&SYSUID                                           
//*                                                                     
//STEP01   EXEC PGM=ICETOOL                                             
//INDD     DD DSN=MTHUSR.INPUT.DATASET,DISP=SHR                         
//OUTDD1   DD DSN=MTHUSR.OUTPUT.DATASET1,                               
//            DISP=(NEW,CATLG,DELETE),                                  
//            SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,                        
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)              
//OUTDD2   DD DSN=MTHUSR.OUTPUT.DATASET2,                               
//            DISP=(NEW,CATLG,DELETE),                                  
//            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')                                       
/*                                                                      
//TOOLMSG  DD DSN=MTHUSR.OUTPUT.TOOLMSG1,DISP=SHR                       
//DFSMSG   DD SYSOUT=*                                                  
//  


OUTPUT: -

TOOLMSG: -


MTHUSR.OUTPUT.DATASET1: -


MTHUSR.OUTPUT.DATASET2: -


Explaining Solution: -

  • INDD - Specifies the ddname for input dataset.
  • OUTDD1,OUTDD2 - Specifies the ddname for output dataset.
  • TOOLIN DD * - Specifies the ICETOOL statements for DFSORT.
  • CTL1CNTL DD *, CTL2CNTL DD * - Specifies the DFSORT statements for processing.
  • TOOLMSG - Specifies ICETOOL message data set.
  • DFSMSG - Specifies DFSORT message data set.
  • COPY FROM(INDD) TO(OUTDD1) USING(CTL1) - Copies the data records which satisfies the selection criteria specified in CTL1 from INDD to OUTDD1.
  • MODE STOP - Stops the process if the above statement throws an error.
  • COPY FROM(INDD) TO(OUTDD2) USING(CTL2) - Copies the data records which satisfies the selection criteria specified in CTL2 from INDD to OUTDD2.
  • INCLUDE COND=(60,2,CH,EQ,C'IN') - Selection criteria to copy the records which are having ‘IN’ from 60th byte of length 2 bytes.
  • INCLUDE COND=(60,2,CH,EQ,C'US') - Selection criteria to copy the records which are having ‘US’ from 60th byte of length 2 bytes.