👁 0
Q: What are the four divisions of a COBOL program?
Answer:
- IDENTIFICATION DIVISION - Program identification (PROGRAM-ID)
- ENVIRONMENT DIVISION - Hardware/software environment, file assignments
- DATA DIVISION - Data definitions (FILE, WORKING-STORAGE, LINKAGE SECTION)
- PROCEDURE DIVISION - Executable code and business logic
Only IDENTIFICATION and PROCEDURE DIVISION are mandatory.
👁 0
Q: What is the difference between PARM and SYSIN for passing parameters?
Answer:
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 /*
👁 0
Q: What is the purpose of COMMAREA in CICS?
Answer:
COMMAREA (Communication Area) is used to pass data between programs or between transactions in pseudo-conversational programming.
Uses:
- Pass data between LINK/XCTL programs
- Save data between pseudo-conversational transactions
- Maximum size: 32KB
How it works:
- Calling program: COMMAREA option on LINK/XCTL/RETURN
- Called program: DFHCOMMAREA in LINKAGE SECTION
- Check EIBCALEN for length (0 = no COMMAREA)
* Calling program
EXEC CICS LINK
PROGRAM('SUBPROG')
COMMAREA(WS-DATA)
LENGTH(100)
END-EXEC.
* Called program
LINKAGE SECTION.
01 DFHCOMMAREA PIC X(100).
IF EIBCALEN > 0
MOVE DFHCOMMAREA TO WS-DATA
END-IF.
👁 0
Q: Explain PROCEDURE DIVISION USING
Answer:
PROCEDURE DIVISION USING defines parameters for called program. Parameters match LINKAGE SECTION definitions. Order matches calling program's USING clause. Establishes addressability to passed data. BY REFERENCE/VALUE/CONTENT options inherited from CALL.
👁 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 COMMAREA and how to use it?
Answer:
COMMAREA (Communication Area) passes data between programs and transactions. EXEC CICS LINK/XCTL COMMAREA(data) LENGTH(len). Receiving program has DFHCOMMAREA in LINKAGE. Max 32KB. Preserved across pseudo-conversational iterations.
👁 0
Q: Explain LINK vs XCTL
Answer:
LINK calls program and returns. EXEC CICS LINK PROGRAM(name). Calling program resumes after LINK. XCTL transfers permanently - no return. EXEC CICS XCTL PROGRAM(name). Use LINK for subroutines, XCTL for navigation.
👁 0
Q: What causes S0C4 in batch?
Answer:
S0C4 is protection exception - addressing unallocated memory. Causes: uninitialized pointer, subscript out of range, incorrect LINKAGE SECTION. Check CEEDUMP for offset. Likely program bug. Use debugger to trace.
👁 0
Q: Explain PCT
Answer:
PCT (Program Control Table) defines transactions. Now RDO TRANSACTION. Links TRANSID to initial program. Security, priority, other options. CEDA DEFINE TRANSACTION.
👁 0
Q: What is LINKAGE SECTION?
Answer:
LINKAGE SECTION defines parameters received from calling program. Items here have no memory until CALL provides addresses via USING clause. Address established at runtime. Used for both passed parameters and dynamically addressed data.
👁 0
Q: What is POINTER data type?
Answer:
USAGE POINTER stores memory addresses. SET ptr TO ADDRESS OF data. Used with SET ADDRESS OF linkage-item TO ptr. CALL with BY REFERENCE returns addresses. Supports dynamic memory and chained structures.
👁 0
Q: What is STEPLIB vs JOBLIB?
Answer:
JOBLIB at job level provides program libraries for all steps. STEPLIB at step level overrides JOBLIB for that step. STEPLIB takes precedence. Both searched before LINKLIST. Multiple libraries concatenated. DDN must be STEPLIB/JOBLIB exactly.
👁 0
Q: What causes S806 abend?
Answer:
S806 is module not found. Check: program name spelling, STEPLIB/JOBLIB correct, library exists and contains module, module link-edited properly, aliases defined. S806-04 means not in JOBLIB/STEPLIB/LINKLIST.
👁 0
Q: What is MRO?
Answer:
MRO (Multi-Region Operation) connects CICS regions. Function shipping sends requests to owning region. Transaction routing sends terminal to AOR. DPL (Distributed Program Link) for remote LINK.
👁 0
Q: What is PGMIDERR?
Answer:
PGMIDERR is program not found. LINK/XCTL to undefined program. Check RDO PROGRAM definition. Or spelling. Must be defined and installed.