Q1
Explain the difference between COND and IF/THEN/ELSE.
COND tests return codes to SKIP steps (negative logic). IF/THEN/ELSE tests conditions to EXECUTE steps (positive logic). IF supports complex expressions. COND on JOB affects all steps, on EXEC affects that step.
Q2
How does DISP parameter work?
DISP=(status,normal,abnormal). Status: NEW/OLD/SHR/MOD. Normal disposition after success. Abnormal after abend. Example: DISP=(NEW,CATLG,DELETE) creates, catalogs if OK, deletes if abend.
Q3
What does TYPRUN=SCAN do?
TYPRUN=SCAN validates JCL syntax without execution. No resources allocated, no programs run. Checks for errors before production submission.
Q4
Explain SPACE parameter options.
SPACE=(unit,(primary,secondary,directory)). Units: TRK/CYL/blocksize. Directory for PDS. Options: RLSE (release unused), CONTIG (contiguous), ROUND (round to cylinder).
Q5
What is DD DUMMY?
DD DUMMY discards output, provides EOF for input. No I/O actually performed. Equivalent: DSN=NULLFILE. Used for testing or optional files.
Q6
Explain REGION parameter.
REGION specifies memory limit. REGION=0M means system default (no limit). REGION=4M limits to 4MB. On JOB affects all steps, on EXEC affects that step.
Q7
What is DD * vs DD DATA?
DD * starts instream data ending with /*. DD DATA allows DLM=xx for custom delimiter when data contains /*. DD DATA,DLM=@@ ends with @@.
Q8
What is NOTIFY parameter?
NOTIFY=userid sends completion message. NOTIFY=&SYSUID notifies submitter. Multiple: NOTIFY=(user1,user2). Essential for batch monitoring.
Q9
How does IEFBR14 work?
IEFBR14 is null program (Branch Register 14 = return). Used for dataset management: create, delete, catalog. Example: //DEL EXEC PGM=IEFBR14 //DD DD DSN=file,DISP=(MOD,DELETE).
Q10
What is the difference between PARM and SYSIN for passing parameters?
PARM (EXEC statement):
- Limited to 100 characters
- Passed in memory to program
- Accessed via LINKAGE SECTION
- Good for small, simple parameters
SYSIN (DD statement):
- No practical size limit
- Read as a file by program
- Can contain multiple records
- Good for control cards, complex input
// PARM example //STEP1 EXEC PGM=MYPROG,PARM='PARAM1,PARAM2' // SYSIN example //SYSIN DD * CONTROL OPTION1 DATE=20231215 LIMIT=1000 /*
Q11
What is STEPLIB vs JOBLIB?
JOBLIB at job level provides libraries for all steps. STEPLIB at step level overrides JOBLIB for that step. Both searched before LINKLIST. Can concatenate multiple libraries.
Q12
Explain GDG (Generation Data Groups).
GDG maintains dataset versions. Define base with IDCAMS. Reference: (+1)=new, (0)=current, (-1)=previous. LIMIT controls kept generations. Useful for backup/archive strategies.
Q13
How to pass data between job steps?
DISP=PASS passes datasets between steps. Symbolic parameters carry values. GDG relative references. Temporary datasets (&&) auto-pass. JCL symbols set by SET statement.
Q14
What causes S0C7 in batch?
S0C7 is data exception - non-numeric in numeric field. Check: input file data, variable initialization, REDEFINES usage, field alignment. Find OFFSET in dump.
Q15
How does SORT utility work?
SORT FIELDS=(position,length,format,order). Input: SORTIN. Output: SORTOUT. Control: SYSIN. Options: INCLUDE/OMIT for filtering, OUTREC/INREC for reformatting.
Q16
What is IDCAMS and common commands?
IDCAMS manages VSAM and catalogs. Commands: DEFINE CLUSTER, DELETE, REPRO (copy), LISTCAT (list), ALTER, VERIFY, PRINT. IF/THEN/ELSE for conditional logic.
Q17
How to create and reference procedures?
PROC defines procedure, PEND ends it. Store in PROCLIB. Reference: EXEC procname or EXEC PROC=procname. Override: //procstep.ddname DD overrides.
Q18
Explain OUTPUT statement.
OUTPUT defines SYSOUT characteristics. //OUT1 OUTPUT CLASS=A,COPIES=2. Reference: SYSOUT=*,OUTPUT=*.OUT1. Centralizes output specifications.
Q19
What is SMS (Storage Management)?
SMS automates storage management. DATACLAS defines data attributes, STORCLAS controls placement, MGMTCLAS defines retention. ACS routines assign classes automatically.
Q20
What is JCLLIB ORDER?
JCLLIB ORDER specifies procedure library search order. Must be before first EXEC. Takes precedence over system proclibs.
Q21
Explain COND parameter logic.
COND skips step IF condition is TRUE. COND=(4,LT) skips if 4 < any prior RC. COND=(0,NE) skips unless all prior steps returned 0. Use IF for clarity.