ICETOOL JCL Setup

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.

Control Statements (Core Syntax)
Progress0 of 0 lessons

Required DDs for Every ICETOOL Step

These three DDs are required regardless of which operators you use:

Required ICETOOL DDs
DD namePurpose
TOOLMSGWhere ICETOOL writes its own messages. Use SYSOUT=* or SYSOUT=A. Missing it can cause return code 20.
DFSMSGWhere DFSORT messages (ICE000I, etc.) are written when ICETOOL calls DFSORT. Usually SYSOUT=*.
TOOLINDataset containing the operator statements (COPY, SORT, COUNT, etc.). Required.

TOOLIN: Operator Statements

TOOLIN can be in-stream (DD *) or a cataloged dataset. In-stream is common for small jobs:

jcl
1
2
3
4
5
//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.

USING and the xxxxCNTL DD

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:

jcl
1
2
3
4
//CTL1CNTL DD * INCLUDE COND=(60,2,CH,EQ,C'IN') /* //CTL2CNTL DD DSN=MY.PROCS(SORT1),DISP=SHR

Input and Output DDs

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).

Complete Example

jcl
1
2
3
4
5
6
7
8
9
10
11
12
13
//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.

Explain It Like I'm Five

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.

Exercises

  1. Write the JCL for an ICETOOL step that runs COUNT FROM(INDD) USING(CTL1). Include TOOLMSG, DFSMSG, TOOLIN, INDD, and CTL1CNTL.
  2. What DD name must you allocate if you code USING(MYCTL)?
  3. Why might the step fail with return code 20 if TOOLMSG is missing?

Quiz

Test Your Knowledge

1. Which DD statements are always required for an ICETOOL step?

  • SORTIN, SORTOUT only
  • TOOLMSG, DFSMSG, and TOOLIN—messages and operator list
  • Only TOOLIN
  • SYSOUT only

2. If you code SORT FROM(INDD) TO(OUTDD) USING(CTL1), which DD must you allocate?

  • Only INDD and OUTDD
  • INDD, OUTDD, and CTL1CNTL—the USING prefix plus CNTL
  • CTL1 only
  • SYSIN

3. What is the purpose of DFSMSG vs TOOLMSG?

  • They are the same
  • TOOLMSG receives ICETOOL messages; DFSMSG receives DFSORT messages (e.g. ICE000I) from each sort/copy/merge
  • Only DFSMSG is used
  • TOOLMSG is for input

4. Can you use in-stream data for TOOLIN?

  • No, only a dataset
  • Yes—use TOOLIN DD * and put operator statements on the following lines, ending with /*
  • Only for COPY
  • Only for COUNT

5. How do you supply different control statements for two operators in the same step?

  • You cannot
  • Use two different USING prefixes and two CNTL DDs—e.g. USING(CTL1) with CTL1CNTL and USING(CTL2) with CTL2CNTL
  • Put both in TOOLIN
  • Use one SYSIN