Job step
One program run inside a job. A job is a list of steps that run in order.
Also written step
Why it matters. Real work has stages: get the data, sort it, report on it. Each stage is a step.
See it
What will happen
- 1
The machine makes ZB0001
.DEV .WORKBecause your DD line asked for it. - 2
IEFBR14 runsAnd does nothing, on purpose.
- 3
Finished, RC 0The file is kept.
Syntax
//stepname EXEC PGM=program //ddname DD ...
- stepname
- Names the step. Each step in a job should have its own.
- EXEC
- Starts the step and says what to run.
- DD
- The files the step uses.
- COND / IF
- Decide whether the step runs.
- Return code
- Each step ends with one.
Try it EXEC
- 1
You're editing job TWOSTEP. It has STEP1 already. Write the EXEC statement that starts a second step, STEP2, running the program IEFBR14.
JCL //STEP2 EXEC PGM=IEFBR14 - 2
Submit the job TWOSTEP from your DEV JCL library.
SUBMIT 'ZB0001.DEV.JCL(TWOSTEP)' - 3
Read the step messages, JESYSMSG.
OUTPUT TWOSTEP JESYSMSG
Remember
- A step is one EXEC statement and the DDs under it.
- Steps run in order, from top to bottom.
- Each step ends with its own return code.
The usual mistake
Two steps both called STEP1
The messages could not tell them apart, and a later step could not refer to the right one.
Give each step its own name
On real z/OS
A job can have up to 255 steps on z/OS. MF/OS runs steps in order and stops at an abend, as z/OS does, except for steps with COND=EVEN or COND=ONLY.
Where can I practise Job step?
Right here, at ZedBank. You take a junior job at a simulated bank and use Job step in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- JobA unit of batch work submitted to the system, made up of one or more steps that run in order.
- EXEC statementThe JCL statement that starts a step by naming the program or procedure to run.
- DD statementThe JCL statement that connects a name inside a program to a real dataset outside it.
- Return codeA number a program leaves behind saying how it went. Zero for clean, higher numbers for warnings and failures.
- COND parameterThe older way of telling a job step whether to run, based on the return codes of earlier steps.