Introduction
Every JCL statement is more than just text—it’s a carefully positioned set of fields that your mainframe parser relies on to understand what you mean.
From the mandatory //
in columns 1–2 to the precise breakpoints for names, operations, and parameters, even a single-character misplacement can turn a valid job into an abend or silently alter its behavior.
Mastering the layout—knowing where identifiers belong, how to continue long statements correctly, and when positional values give way to flexible keywords—is essential for reliable, maintainable batch processing.
You’ll learn how to spot accidental DD concatenations, use the null statement to gracefully end or test your job, and keep every line within the 71-column limit so nothing gets quietly dropped. With these rules under your belt, your JCL will run exactly as you intend, without mysterious failures or unintended side-effects.
IBM Docs - Learn How to create and Submit JCL.
JCL Statement Format & Field Positions
📖 Reference: IBM Docs – JCL Statement Fields
JCL expects statements to be placed in very specific columns. Even a small shift can break or silently change the behavior of your job.
JCL Statement Layout
Area | Columns | Use |
---|---|---|
Identifier | 1–2 | Must be // |
Name | 3–10 | Step name, DD name, or job name |
Operation | 4–71 | JOB , EXEC , DD , etc. |
Parameters | 4–71 | Example: PGM=MYPGM , DISP=SHR |
Continuation | 72 | Space |
Things to watch for
- No
//
in column 1 = not a JCL statement - Job name is required. Step or DD name is optional (but required for first DD).
- If line continues, leave col 72 blank and continue next line from col 4–16.
Positional vs. Keyword Parameters
📖 Reference: IBM Docs – Parameter Field
Positional Parameters
- Must appear in a specific order
- Usually required, and the system expects them first
- Examples:
PGM=MYPROG
on an EXEC statementDATA
on a DD statementprogrammer-name
on a JOB statement
Important: If skipping a positional parameter, use a comma to mark its place
//STEP1 EXEC ,REGION=4M
Keyword Parameters
- Format:
keyword=value
- Can be in any order
- Often optional
- Example:
//INPUT DD DSN=MY.FILE,DISP=SHR
This can also be written:
//INPUT DD DISP=SHR,DSN=MY.FILE
- Trailing commas: Don’t leave a comma at the end of a parameter list.
DD Statement Concatenation
What happens if you omit DD name after the first one?
JCL assumes you're concatenating datasets.
Example:
//INFILE DD DSN=MY.FILE1,DISP=SHR
// DD DSN=MY.FILE2,DISP=SHR
This treats both files as one logical input.
When this causes issues
If you forgot to give a new DDNAME for the second dataset, it will be concatenated accidentally. This happens silently — so double-check when repeating DD
statements.
Null Statement (//
) and Step Skipping
What is a null statement?
Reference: IBM Docs - Null Statement
Just two slashes on a line:
//
It tells the system that the job ends here.
Where it's useful
- To manually skip remaining steps in a job
- Acts like an early exit
- Used in testing or when you don’t want to create new JCL just to skip steps
Note: If another //JOB
statement appears after it, a new job begins.
Continuation of a JCL Statement
📖 Reference: IBM Docs – Continuing a JCL
JCL has a hard limit of 71 characters per line. When your statement is too long (e.g., a long PARM value or SPACE parameter), you must continue it properly on the next line — or your job might fail or behave unexpectedly.
Core Rules for Continuation
- Code
//
in columns 1–2 of every line, even the continuation line. - Do not repeat the step name or statement label on the continued line.
- Start continuation content in columns 16 or later.
- Leave column 72 blank (no continuation character like in other languages).
- No trailing comma is needed on the first line, but you must start with a comma on the continuation if you're continuing a list of values.
Correct Example
//*======1====+====2====+====3====+====4====+====5====+====6=========7=========8
//STEP1 EXEC PGM=MYPROG,PARM='AAA,BBB,CCC,
// DDD,EEE'
//
is present in both lines.- STEP1 appears only on the first line.
- Continuation starts neatly from column 16 onward.
- The value continues smoothly.
Common Mistakes
Mistake | Why it's wrong |
---|---|
Omitting // on the second line | That line won’t be treated as a valid JCL statement |
Repeating the STEP name | JCL will throw a syntax error |
Starting continuation before col 16 | JCL treats it as invalid or as a comment |
Going past col 71 | Everything after 71 is ignored silently |
Examples of Where You’ll Need This
- Long
PARM
strings - Complex
SPACE
orDSNTYPE
values - Any situation with multiple sub-parameters that exceed the line limit