JCL interview questions and answers for mainframe developers
JCL interview questions test whether you can read and write the job streams that run mainframe batch work: JOB, EXEC and DD statements, dataset dispositions and space, step control with COND or IF/THEN/ELSE, cataloged procedures with overrides, and generation data groups. Expect to explain common abend codes and how you would restart a failed job without rerunning everything. Interviewers value answers that sound like real production support, not textbook syntax.
By Evin JohnPublished 8 min read
Who gets asked JCL questions
JCL comes up for COBOL and PL/I developers, mainframe testers, batch operations and production control staff, and for data engineers who feed files from mainframe jobs into newer platforms. Banks, insurers, airlines, retailers and government bodies still run large batch cycles this way, and many interviews are run by people who have been paged at night for a failed step. They want to see that you can read a job log, find the failing step, understand why and fix it safely. Practices differ between shops, so it is fine to say how your last team did it.
- Syntax and statementsWhat each statement does, the main parameters and how a job is laid out.
- Read this jobThe interviewer shows a job stream and asks what each step does, what runs if a step fails, and what happens to each dataset.
- Abends and fixesCommon system abend codes, what usually causes each, and where in the output you look.
- Production supportRestarting from a step, rerunning a GDG-based cycle, coordinating with the scheduler and avoiding duplicate updates.
JCL fundamentals questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What are the three main JCL statements? | Structure | JOB identifies the job and its accounting and class settings, EXEC runs a program or procedure as a step, and DD describes each dataset or output a step uses. |
| What does a JCL statement look like? | Layout | It starts with // in columns 1 and 2, then an optional name of up to eight characters, the operation, and parameters separated by commas. //* marks a comment and /* ends in-stream data. |
| Positional versus keyword parameters? | Syntax | Positional parameters must come first and in a fixed order, such as accounting information on the JOB card. Keyword parameters like CLASS= or DISP= can appear in any order after them. |
| What do CLASS and MSGCLASS control? | JOB parameters | CLASS picks the input queue and the kind of initiator that runs the job. MSGCLASS sets the output class for the job log and system messages. |
| How do you pass input to a program in the JCL itself? | In-stream data | //SYSIN DD * followed by the data lines and ended by /*. PARM= on EXEC passes a short parameter string instead. |
| What does SYSOUT=* mean? | Output | Send that output to the same class as MSGCLASS, so it appears with the job's output in SDSF or the shop's spool viewer. |
| What is DD DUMMY? | Testing | A dataset that reads as empty and discards writes. It lets a step run without a real file, which helps in testing or when an optional input is absent. |
| How do you concatenate datasets? | Inputs | Code several DD statements in a row and leave the name off all but the first. The program reads them as one input, in order. |
| What is the role of JES? | Job flow | The Job Entry Subsystem reads the job in, queues it, hands it to an initiator and manages its spooled input and output. JES2 is the common one. |
| What does TYPRUN=SCAN do? | Validation | Checks the JCL for syntax errors without running it. It does not catch every problem, such as missing datasets, but it is a quick first check. |
Datasets: DISP, SPACE and DCB
//DAILYRPT JOB (ACCT01),'DAILY SALES',CLASS=A,MSGCLASS=X,
// NOTIFY=&SYSUID
//*-------------------------------------------------------------
//SORTSTEP EXEC PGM=SORT
//SORTIN DD DSN=PROD.SALES.DAILY,DISP=SHR
//SORTOUT DD DSN=PROD.SALES.SORTED(+1),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(50,10),RLSE),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,8,CH,A,9,4,PD,D)
/*
//*-------------------------------------------------------------
// IF (SORTSTEP.RC = 0) THEN
//REPORT EXEC PGM=SALESRPT
//STEPLIB DD DSN=PROD.LOADLIB,DISP=SHR
//SALESIN DD DSN=PROD.SALES.SORTED(+1),DISP=SHR
//RPTOUT DD SYSOUT=*
// ENDIF- What are the three parts of DISP? Status (NEW, OLD, SHR or MOD), then the normal disposition (CATLG, KEEP, DELETE, PASS, UNCATLG), then the abnormal disposition used if the step abends.
- SHR versus OLD? SHR lets other jobs read the dataset at the same time. OLD asks for exclusive use, which you need when updating it, and can make other jobs wait.
- What does MOD do? Appends to an existing sequential dataset, or creates it if it does not exist. It is handy for logs and dangerous for files that must be rebuilt cleanly on rerun.
- What does SPACE=(CYL,(50,10),RLSE) mean? Allocate 50 cylinders as primary, extend by 10 cylinders at a time as secondary, and release unused space when the dataset closes.
- What is in DCB? Record format (such as FB for fixed blocked or VB for variable blocked), logical record length and block size. BLKSIZE=0 lets the system choose an efficient block size.
- What is a temporary dataset? One named with
&&, such as&&WORK, which lives only for the job. Pass it between steps with DISP=(NEW,PASS) and read it later with a referback. - What is a referback? A pointer to an earlier DD, written like
DSN=*.STEP1.OUTFILE, so the dataset name or attributes are not repeated. - What does the message NOT CATLGD 2 tell you? The job tried to catalog a dataset whose name is already in the catalog, usually because an earlier run created it. The new copy is not cataloged, which can confuse later steps, so delete or rename first in rerunnable jobs.
Step control, procedures and GDGs
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What do return codes 0, 4, 8, 12 and 16 usually mean? | Conventions | By common convention: success, warning, error, severe error and terminal error. The program decides the code, so check what yours sets. |
| Explain COND=(4,LT) on an EXEC statement. | COND logic | The step is bypassed if 4 is less than the return code of any earlier step, meaning any earlier step ended above 4. The test describes when to skip, which is why people misread it. |
| Why do many shops prefer IF/THEN/ELSE over COND? | Readability | IF reads in the positive sense (run when this is true), can test a named step's RC or abend, and nests clearly. COND logic inverted is a classic source of bugs. |
| What do COND=EVEN and COND=ONLY do? | Abends | EVEN runs the step even if an earlier step abended. ONLY runs it only after an abend, which suits cleanup or notification steps. |
| In-stream versus cataloged procedure? | PROCs | An in-stream PROC sits between PROC and PEND in the same job. A cataloged PROC lives in a procedure library, found through JCLLIB ORDER= or the system's default libraries. |
| How do you override a DD inside a procedure? | Overrides | Code a DD named procstep.ddname after the EXEC that calls the procedure, for example //STEP1.INFILE DD DSN=TEST.INPUT,DISP=SHR. |
| What are symbolic parameters? | Reuse | Variables such as &HLQ inside a PROC, given defaults on the PROC statement and values on the EXEC or a SET statement, so one PROC serves test and production. |
| What is a GDG? | Generations | A generation data group: a base name with numbered generations, defined with IDCAMS and a LIMIT. (0) is the current generation, (+1) a new one, (-1) the previous. |
| Within one job, you create (+1) in step 1. How do you read it in step 3? | GDG behavior | Still as (+1). Relative numbers are resolved against the generations that existed when the job started, until the job ends. |
| What do SCRATCH and NOSCRATCH mean on a GDG? | Retention | When a generation rolls off past the limit, SCRATCH deletes it, NOSCRATCH only uncatalogs it and leaves the dataset on disk. |
Utilities and abend questions
- What is IEFBR14 for? It does nothing and ends with return code 0, so the DD statements in its step do the work: allocate a new dataset or delete an old one through DISP.
- Which utility copies a sequential file? IEBGENER, with SYSUT1 as input and SYSUT2 as output. IEBCOPY handles partitioned datasets and their members.
- What does IDCAMS do? Defines and deletes VSAM clusters and GDG bases, copies data with REPRO, prints records and lists catalog entries with LISTCAT. A DELETE followed by SET MAXCC=0 is a common way to make a step rerunnable.
- How do you remove duplicate records with SORT?
SORT FIELDS=...on the key andSUM FIELDS=NONE, which keeps one record per key. INCLUDE or OMIT filter records, and OUTREC reshapes them. - S0C7? A data exception: the program used a field that does not hold valid packed decimal, often spaces or bad input in a numeric field. Find the offset in the dump or listing and check the input record.
- S0C4? A protection exception: the program touched storage it should not, such as a subscript out of range or a bad pointer or linkage.
- S806? The program named on EXEC was not found in STEPLIB, JOBLIB or the system libraries. Check the name and the load library concatenation.
- SB37, SD37 and SE37? Out of space variants: no more room or extents on the volume, no secondary allocation given, or the extent limit reached. Increase primary and secondary or move to a larger or multi-volume allocation.
- S322? The step or job exceeded its CPU TIME limit, often from a loop or an unexpected volume of input.
- S222? The job was cancelled, usually by an operator or automation, so ask why before rerunning.
- What is the difference between a JCL error and an abend? A JCL error stops the job before or during allocation, such as a syntax error or missing dataset, and no program runs. An abend happens while a program is running.
Senior and production support scenarios
- Step 4 of 7 abended overnight. How do you restart? Read the log to find the cause and fix it first. Then check what steps 1 to 3 created and whether step 4 left partial output. Clean up partial datasets or GDG generations, and restart from step 4 with RESTART= on the JOB card or through the scheduler, never blindly from the top.
- A rerun created a duplicate GDG generation. How do you prevent that? Make jobs restartable: delete or roll back the generation on failure, use abnormal dispositions that delete partial output, and document which steps are safe to rerun.
- A job waits for a dataset for hours. Why? Another job holds it with DISP=OLD or is updating it. Find the holder, check the schedule for overlap, and use SHR where the job only reads.
- How do you test JCL changes safely? TYPRUN=SCAN first, then run in a test environment with test high-level qualifiers through symbolics, and compare outputs with a known good run.
- What does a scheduler add on top of JCL? Dependencies between jobs, calendars, triggers on dataset arrival, alerting and restart tools. Products such as Control-M, IBM Workload Scheduler or Broadcom's CA 7 are common; name the one you used.
- How would you hand mainframe output to a cloud data platform? Produce a fixed or delimited extract, record the layout from the copybook, convert EBCDIC and packed decimal fields carefully, transfer securely, and reconcile record counts and totals on both sides.
Fictional example
- Interviewer
- The billing job failed in step BILL020 with S0C7 at two in the morning. What do you do?
- Candidate
- S0C7 means bad numeric data, so I expect an input problem rather than a code change, but I would confirm nothing was promoted recently. I would open the job output, note the offset of the failing instruction and map it to the COBOL statement with the compile listing. That tells me which field, and the dump or a DISPLAY of the record key tells me which record. Usually it is a feed that sent spaces in an amount field. Short term, I would agree with the business whether to correct or skip that record, rerun from BILL020 since earlier steps completed cleanly, and verify counts. Afterwards I would add input validation in an earlier step so a bad record is reported, not fatal.
JCL practice plan
- Days 1 and 2: write a job from memory with three steps: IEFBR14 delete, SORT into a new GDG generation, and IEBGENER copy. Explain every DISP aloud.
- Day 3: rewrite one COND test as IF/THEN/ELSE and explain both readings to a friend who has never seen JCL.
- Day 4: list ten abend codes with a cause and a first check for each, then test yourself in random order.
- Day 5: walk through a full restart scenario, including cleanup of partial outputs and GDG generations, in under three minutes.
JCL usually sits next to other data skills in these interviews: SQL interview questions for DB2-style queries, JDBC interview questions for Java services that read the same data, and ETL testing interview questions for reconciling batch outputs.
Production support answers are scored on sequence: read, diagnose, contain, restart, prevent. Natively, an AI interview assistant for Mac and Windows, transcribes your mock mainframe interview on the computer so you can check whether you jumped to a rerun before reading the log. In practice it can read a job stream or an abend message from a screenshot and suggest what to explain, and with Pro or the free trial it reflects the résumé and job description you add. Transcripts and notes are kept for you to look over.
Questions people ask
What JCL questions are asked in mainframe interviews?
The JOB, EXEC and DD statements, DISP and SPACE parameters, COND versus IF/THEN/ELSE, procedures and overrides, GDGs, utilities such as IEFBR14, IEBGENER, IDCAMS and SORT, common abend codes, and how to restart a failed job.
What does COND=(4,LT) mean in JCL?
The step is bypassed if 4 is less than the return code of any earlier step, in other words if any earlier step ended with a code above 4. COND describes when to skip, which is why many shops prefer IF/THEN/ELSE.
What causes an S0C7 abend?
A data exception: the program used a numeric field that does not contain valid packed decimal data, often spaces or bad input. The failing offset and the compile listing show which field.
What is a GDG in JCL?
A generation data group: a set of datasets under one base name with numbered generations. (0) is the current one, (+1) creates a new one and (-1) is the previous, with a LIMIT on how many are kept.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
