Running ICETOOL in a batch job requires a specific JCL layout: EXEC PGM=ICETOOL, then the required DDs for messages and operator input, plus the input/output and control statement DDs that your operators reference. This page explains how to set up the JCL: TOOLMSG, DFSMSG, TOOLIN, and the xxxxCNTL datasets used by USING(prefix). We also cover in-stream vs dataset allocation and naming conventions so your ICETOOL step runs correctly.
These three DDs are required regardless of which operators you use:
| DD name | Purpose |
|---|---|
| TOOLMSG | Where ICETOOL writes its own messages. Use SYSOUT=* or SYSOUT=A. Missing it can cause return code 20. |
| DFSMSG | Where DFSORT messages (ICE000I, etc.) are written when ICETOOL calls DFSORT. Usually SYSOUT=*. |
| TOOLIN | Dataset containing the operator statements (COPY, SORT, COUNT, etc.). Required. |
TOOLIN can be in-stream (DD *) or a cataloged dataset. In-stream is common for small jobs:
12345//TOOLIN DD * COPY FROM(INDD) TO(OUTDD) COUNT FROM(INDD) USING(CTL1) /*
The lines between DD * and /* are the operator list. Continuation is with a hyphen at end of line. Blanks and lines starting with * (comment) are allowed.
When an operator specifies USING(prefix), ICETOOL looks for a DD named prefix + CNTL. So USING(CTL1) requires CTL1CNTL. That DD holds the DFSORT control statements (SORT FIELDS=, INCLUDE, OUTREC, etc.) for that operation. You can use in-stream or a PDS member:
1234//CTL1CNTL DD * INCLUDE COND=(60,2,CH,EQ,C'IN') /* //CTL2CNTL DD DSN=MY.PROCS(SORT1),DISP=SHR
Each operator that uses FROM(indd) needs that DD allocated. Each operator that uses TO(outdd) needs that DD. Names are arbitrary: FROM(MYIN) and TO(MYOUT) require MYIN and MYOUT. Allocate them with the usual DISP, SPACE, DCB (or DSN for existing datasets).
12345678910111213//STEP01 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //INDD DD DSN=MY.INPUT,DISP=SHR //OUTDD DD DSN=MY.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(2,1)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) //TOOLIN DD * SORT FROM(INDD) TO(OUTDD) USING(CTL1) /* //CTL1CNTL DD * SORT FIELDS=(1,20,CH,A) OUTREC FIELDS=(1,80) /*
TOOLMSG and DFSMSG are required. INDD and OUTDD are used by SORT. CTL1CNTL holds the SORT FIELDS and OUTREC. The step runs one SORT operation.
JCL is like a checklist for the system. “Run ICETOOL” (EXEC). “Here’s where to put your messages” (TOOLMSG, DFSMSG). “Here’s the list of jobs to do” (TOOLIN). “Here’s the extra instructions for job 1” (CTL1CNTL). “Here’s the input box” (INDD) “and the output box” (OUTDD). If you forget the list (TOOLIN) or the message place (TOOLMSG/DFSMSG), the helper (ICETOOL) can’t run or can’t tell you what happened.
1. Which DD statements are always required for an ICETOOL step?
2. If you code SORT FROM(INDD) TO(OUTDD) USING(CTL1), which DD must you allocate?
3. What is the purpose of DFSMSG vs TOOLMSG?
4. Can you use in-stream data for TOOLIN?
5. How do you supply different control statements for two operators in the same step?