Q1
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 /*
Q2
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.
Q3
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.
Q4
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.
Q5
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.
Q6
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.
Q7
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.
Q8
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.
Q9
Explain OUTPUT statement.
OUTPUT defines SYSOUT characteristics. //OUT1 OUTPUT CLASS=A,COPIES=2. Reference: SYSOUT=*,OUTPUT=*.OUT1. Centralizes output specifications.
Q10
What is SMS (Storage Management)?
SMS automates storage management. DATACLAS defines data attributes, STORCLAS controls placement, MGMTCLAS defines retention. ACS routines assign classes automatically.
Q11
What is JCLLIB ORDER?
JCLLIB ORDER specifies procedure library search order. Must be before first EXEC. Takes precedence over system proclibs.
Q12
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.