CICS Realtime (Scenario based) Interview Questions (1 - 10)
1. How do you define a CICS program in the CICS region?
To define a CICS program in the region, you use the Program Processing Table (PPT) either statically (DFHCSDUP) or dynamically (CEDA).
CEDA DEFINE PROGRAM(PROGNAME)
GROUP(GROUPNAME)
LANGUAGE(COBOL)
- PROGNAME: Name of the program.
- GROUP: CICS resource group the program belongs to.
- LANGUAGE: Programming language (e.g., COBOL, PL/I).
2. How do you handle errors in CICS programs? Provide a coding example.
Errors are handled using the EXEC CICS HANDLE CONDITION command, which redirects control to a specific label or paragraph when a specified condition occurs. For example -
EXEC CICS
HANDLE CONDITION
NOTFND(ERROR-ROUTINE)
END-EXEC.
EXEC CICS READ FILE('EMPFILE')
INTO(WS-EMP-DATA)
RIDFLD(EMP-ID)
END-EXEC.
...
ERROR-ROUTINE.
MOVE 'Record not found.' TO WS-ERROR.
EXEC CICS RETURN END-EXEC.
3. What are CICS BMS maps and how do you define them?
CICS BMS (Basic Mapping Support) maps define screen layouts for CICS applications. They separate screen design from application logic, allowing for formatted, interactive displays (like maps for data entry or menus).
How to Define BMS Maps?
- Using BMS Macros:
- DFHMSD – Declares the mapset.
- DFHMDI – Defines the map (screen).
- DFHMDF – Defines individual fields (attributes, positions, lengths).
- Assemble the macros to generate:
- A load module (used at runtime)
- A copybook (used in COBOL for referencing fields)
4. When using multiple maps, how does one determine the storage in the symbolic map?
When multiple maps are used in a mapset, each map gets its own symbolic map, and the total storage is determined by the combined size of all symbolic maps in the mapset.
5. What are the primary differences between PCT and FCT?
PCT (Program Control Table) | FCT (File Control Table) |
---|---|
Defines transaction-to-program relationships | Defines file and dataset access for CICS programs |
Maps a Transaction ID (TRANID) to the program that processes it | Maps a logical filename (DDNAME) to a physical dataset |
Used during transaction initiation (e.g., EXEC CICS START or user input) | Used for file operations (e.g., READ, WRITE, DELETE) |
Contains: Transaction ID, Program name to be executed and Security & scheduling attributes. | Contains: Dataset name (DSNAME), File access mode (VSAM, TSQ, TDQ, etc.), Record length & key details (for VSAM). |
6. What are some primary transaction uses in the context of CICS?
Transaction | Purpose |
---|---|
CEMT | Master transaction to view, process. |
CEBR | Browse Temporary Storage Queue |
CECI | Command-level interpreter |
CEDF | Debugging tool |
CESF | Sign-off |
CESN | Sign-on (security) |
7. What effect would it have on RECEIVE MAP if we press PF and PA keys?
The RECEIVE MAP command completes, but EIBAID will reflect the pressed key. The program must check EIBAID to decide further processing (e.g., branching logic). If PA1 is pressed, CICS may override the program flow (unless explicitly handled).
8. What is the process of terminating a transaction?
In CICS, a transaction can be terminated in the following ways:
- Normal Termination (Explicit) –
- Using EXEC CICS RETURN in the application program, which passes control back to CICS.
- Optionally, COMMIT (SYNCPOINT) is issued to finalize updates before termination.
- Abnormal Termination (Forced) –
- PA1 Key – Pressing PA1 typically forces an immediate rollback and exits the transaction.
- Transaction Timeout – If the transaction exceeds its defined run time limit, CICS aborts it.
- Program ABEND – If the program crashes, CICS terminates the transaction with a dump (if enabled).
- Implicit Termination –
- When the last program issues RETURN without specifying a next transaction.
- If the program ends without a CICS command (rare, usually results in an error).
9. What are the situations under which NEWCOPY is required?
- After a Program Update – When a COBOL/PL/I/Assembler program is modified and recompiled, NEWCOPY refreshes the in-memory copy without a CICS restart.
- First-Time Load – If a program is newly installed and needs to be loaded into CICS for execution.
- Abend Fix – If a program abends due to a logic error and a corrected version is deployed.
10. Can you have CICS code in a copybook? If yes, what happens during compilation?
Yes, you can include CICS commands in a copybook. The copybook must be included before translation, not after. CICS code is allowed in copybooks, and during compilation, the CICS translator processes it normally as part of the main program.