What JCL is for
JCL is not a programming language. It is a work order. It says which program to run, what files to give it, and what to do with those files afterwards. There are no loops and no arithmetic, and that is deliberate.
Three statements carry the whole language
A job contains one or more steps. Each step runs one program. Each step's DD statements connect the names the program uses internally to real datasets in the system. That is the entire mental model.
//PAYRUN01 JOB (ACCT01),'MONTHLY PAY',CLASS=A,MSGCLASS=X, // NOTIFY=&SYSUID //* ------ step 1: calculate ------ //STEP010 EXEC PGM=PAYCALC,PARM='RUNDATE=20260930' //STEPLIB DD DSN=PROD.PAY.LOADLIB,DISP=SHR //INFILE DD DSN=PROD.PAY.MASTER,DISP=SHR //OUTFILE DD DSN=PROD.PAY.CALC,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(50,10),RLSE), // DCB=(RECFM=FB,LRECL=200,BLKSIZE=0) //SYSOUT DD SYSOUT=* //* ------ step 2: report, only if step 1 was clean ------ //STEP020 EXEC PGM=PAYRPT,COND=(0,LT,STEP010) //STEPLIB DD DSN=PROD.PAY.LOADLIB,DISP=SHR //INFILE DD DSN=PROD.PAY.CALC,DISP=(OLD,DELETE,DELETE) //REPORT DD SYSOUT=* //SYSOUT DD SYSOUT=*
The rules of the page
- Statements start with
//in columns 1 and 2. A comment is//*. - The name field starts in column 3 and is up to 8 characters.
- Coding is read only up to column 71. Column 72 marks continuation.
- To continue, end the previous line with a comma and start the next with
//and at least one blank before the parameter. /*on its own ends inline data.//on its own ends the job.
Why there are no loops
JCL describes *what resources a unit of work needs*, so the system can allocate and serialise them before anything runs. If JCL could loop, the system could not know in advance what a job would touch — and that advance knowledge is what makes safe automatic dataset serialisation possible. Logic belongs inside your program; JCL just wires it up.
Example, line by line
//PAYRUN01 JOB (ACCT01),'MONTHLY PAY',CLASS=A,MSGCLASS=X//STEP010 EXEC PGM=PAYCALC//INFILE DD DSN=PROD.PAY.MASTER,DISP=SHR//SYSOUT DD SYSOUT=*Try it yourself
Which of the three JCL statement types names the program a step runs?
Show a hint
It is the one with PGM= on it.
Show the solution
EXEC. PGM= names a program; PROC= (or just a name) calls a procedure.
Common mistakes
Conditional execution exists (COND and IF/THEN/ELSE) but it is deliberately limited. If you find yourself fighting it, the logic belongs in a program or in the scheduler.
A parameter list that continues must end the line with a comma. Without it, the next line is read as a new statement and fails confusingly.
Duplicate step names make COND and restart references ambiguous. Keep them unique and sequential — STEP010, STEP020.
What you will see at work
- You will almost never write JCL from scratch. You will copy the nearest working job and change it — which is why reading it accurately matters more than writing it.
- Sites have JCL standards: step naming, accounting fields, standard PROCs. Follow them; deviations get rejected in review.
- Production JCL lives in a controlled library. Your copy for testing lives in your own.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.