👁 0
Q: What is the difference between COND and IF/THEN/ELSE in JCL?
Answer:
COND Parameter:
- Tests return codes from previous steps
- Bypasses step if condition is TRUE
- Works opposite to programming logic!
- COND=(4,LT) means: Skip if 4 < any previous RC
IF/THEN/ELSE:
- More intuitive programming-like syntax
- Executes steps when condition is TRUE
- Supports AND, OR operators
- Can check ABEND conditions
Example:
// Using COND (skip if RC < 4) //STEP2 EXEC PGM=PROG2,COND=(4,LT) // Using IF/THEN/ELSE // IF STEP1.RC = 0 THEN //STEP2 EXEC PGM=PROG2 // ELSE //ERROR EXEC PGM=ERRPROC // ENDIF
👁 0
Q: What is EXEC CICS structure?
Answer:
EXEC CICS marks CICS commands. EXEC CICS READ FILE('name') INTO(area) RIDFLD(key) END-EXEC. Commands: READ, WRITE, SEND, RECEIVE, LINK, XCTL. RESP and RESP2 capture return codes. Translator converts to CALL.
👁 0
Q: What is the difference between COND and IF/THEN/ELSE?
Answer:
COND tests return codes to skip steps (negative logic - skips IF true). IF/THEN/ELSE tests conditions to execute steps (positive logic). IF supports complex expressions, COND is simpler but confusing. IF preferred for readability. COND on JOB affects all steps; on EXEC affects that step.
👁 0
Q: How to handle CICS RESP codes?
Answer:
RESP and RESP2 capture command results. EXEC CICS command RESP(ws-resp) RESP2(ws-resp2). Check DFHRESP(NORMAL) for success. RESP contains condition. RESP2 has additional info. Always check after commands.
👁 0
Q: What is EIB?
Answer:
EIB (Execute Interface Block) contains execution info. EIBCALEN=COMMAREA length. EIBTRNID=transaction. EIBAID=attention key. EIBDATE/EIBTIME=date/time. EIBRESP/EIBRESP2=response codes. Automatically available in COBOL.
👁 0
Q: How to check job status?
Answer:
SDSF DA/ST panels show jobs. TSO STATUS command. JES2 J'jobname'. JESMSGLG shows JCL, allocation. JESYSMSG has error details. Return code in JESMSGLG. Condition codes per step. Check SYSOUT for program output.
👁 0
Q: Explain EIBRESP values
Answer:
EIBRESP holds response code. 0=NORMAL. Non-zero indicates condition. Use DFHRESP(condition) for comparison. Common: DFHRESP(NOTFND), DFHRESP(DUPKEY), DFHRESP(INVREQ). Check documentation.
👁 0
Q: What is FILE STATUS and common codes?
Answer:
FILE STATUS is a 2-byte field capturing I/O operation results. 00=success, 10=end-of-file, 22=duplicate key, 23=record not found, 35=file not found, 39=file attribute mismatch, 41=file already open, 47=not opened input. Essential for error handling.
👁 0
Q: How to use IDCAMS conditionally?
Answer:
IF LASTCC/MAXCC condition THEN command. Example: IF MAXCC < 8 THEN REPRO... SET MAXCC/LASTCC resets codes. Allows conditional processing in IDCAMS job steps.