Quiz: CICS Fundamentals
Multiple Choice
1. What is the maximum length of a CICS transaction identifier?
a) 2 characters b) 4 characters c) 8 characters d) 16 characters
2. What does EIBCALEN contain on the first invocation of a pseudo-conversational transaction (when the user first types the transaction ID)?
a) The length of the program's WORKING-STORAGE b) 0 c) The length of the DFHCOMMAREA in the LINKAGE SECTION d) -1
3. In a BMS field definition, which attribute allows the user to type data into the field?
a) ASKIP b) PROT c) UNPROT d) BRT
4. What is the purpose of the COMMAREA in pseudo-conversational CICS programming?
a) To communicate between CICS and DB2 b) To store temporary data during screen display c) To preserve state between task invocations d) To pass data from COBOL to assembler
5. What happens when you execute EXEC CICS RETURN END-EXEC without a TRANSID option?
a) The task ends and restarts immediately b) The task ends and the conversation continues c) The task ends and the conversation is terminated d) A CICS error occurs
6. Which EIB field tells you which key the user pressed?
a) EIBTRNID b) EIBTRMID c) EIBAID d) EIBFN
7. What BMS macro defines an individual field on a screen?
a) DFHMSD b) DFHMDI c) DFHMDF d) DFHBMS
8. What is the difference between XCTL and LINK?
a) XCTL is faster; LINK is slower b) XCTL transfers control without returning; LINK calls and returns c) XCTL is for COBOL; LINK is for assembler d) There is no difference
9. Which RESP value indicates that a RECEIVE MAP found no modified data on the screen?
a) NOTFND b) MAPFAIL c) INVREQ d) LENGERR
10. Why should you never use STOP RUN in a CICS program?
a) It causes a compile error b) It terminates the entire CICS region, not just the task c) It causes a DB2 disconnect d) It is deprecated in modern COBOL
11. What does the IC attribute in a BMS field definition specify?
a) Input Control — the field accepts input b) Initial Cursor — the cursor starts at this field c) Integrity Check — data validation d) Internal Counter — field position counter
12. Which SEND MAP option sends only the data values without refreshing labels and attributes?
a) MAPONLY b) ERASE c) DATAONLY d) ERASEAUP
13. In the symbolic map, what does a field's L (length) value of 0 after RECEIVE MAP indicate?
a) The field is empty b) The field was not modified by the user c) The field is protected d) An error occurred
14. What is the recommended approach for error handling in new CICS programs?
a) HANDLE CONDITION b) HANDLE ABEND c) RESP/RESP2 on each command d) IGNORE CONDITION
15. Which CICS command should be used instead of the COBOL DISPLAY verb for debugging output?
a) EXEC CICS SEND TEXT b) EXEC CICS WRITEQ TD c) EXEC CICS WRITE JOURNAL d) EXEC CICS PUT CONTAINER
True or False
16. A single CICS region can run multiple tasks concurrently, each serving a different user. ___
17. In pseudo-conversational design, working storage values are preserved between user interactions. ___
18. The COBOL OPEN, READ, and WRITE verbs can be used for file I/O in CICS programs. ___
19. The BMS physical map and symbolic map are generated from the same source definition. ___
20. An explicit EXEC SQL COMMIT is the recommended way to commit database changes in CICS. ___
Short Answer
21. Explain the difference between conversational and pseudo-conversational CICS programming. Why is pseudo-conversational preferred?
22. A user reports that their CICS screen sometimes shows data from the previous inquiry mixed with data from the current inquiry. What is the most likely cause, and how do you fix it?
23. Describe the role of the "stopper field" in a BMS map definition. What happens if you omit it after an input field?
24. Draw the sequence of events (from CICS's perspective) when a user types a transaction ID and presses Enter, sees a screen, enters data, and presses Enter again.
25. Explain why CICS programs should avoid long-running operations (like processing 100,000 rows or calling a slow web service). What alternatives exist for long-running work in a CICS environment?
Answer Key
1. b) 4 characters — CICS transaction IDs are 1-4 characters.
2. b) 0 — No COMMAREA was passed because this is the first invocation.
3. c) UNPROT — Unprotected fields allow user input.
4. c) To preserve state between task invocations — since working storage is lost when the task ends.
5. c) The task ends and the conversation is terminated — the user returns to a blank screen or menu.
6. c) EIBAID — the Attention Identifier field.
7. c) DFHMDF — Map Data Field definition.
8. b) XCTL transfers control without returning; LINK calls and returns.
9. b) MAPFAIL — indicates no modified data was found.
10. b) It terminates the entire CICS region, not just the task.
11. b) Initial Cursor — the cursor is positioned at this field when the map is displayed.
12. c) DATAONLY — sends only data field values.
13. b) The field was not modified by the user.
14. c) RESP/RESP2 on each command — provides explicit, readable error checking.
15. b) EXEC CICS WRITEQ TD — writes to a transient data queue for logging.
16. True — CICS is a multitasking system.
17. False — Working storage is lost when the task ends. State must be preserved in the COMMAREA.
18. False — COBOL file I/O verbs are not allowed in CICS. Use EXEC CICS file commands.
19. True — The same BMS source with TYPE=&SYSPARM generates either the physical map (TYPE=MAP) or symbolic map (TYPE=DSECT).
20. False — CICS manages the unit of work. Use SYNCPOINT if explicit commit is needed, not EXEC SQL COMMIT.
21. In conversational programming, the task stays active while waiting for user input, consuming resources (memory, connections) even though it is idle. In pseudo-conversational programming, the task ends after sending the screen and a new task starts when the user responds. Resources are held only during actual processing. Pseudo-conversational is preferred because it allows CICS to serve thousands of concurrent users efficiently — resources are consumed only during the brief processing intervals, not during the long think-time intervals.
22. The most likely cause is failing to INITIALIZE the output map area (ACCTINQO) before populating it with new data. Fields not explicitly set will retain values from a previous interaction. Fix: add INITIALIZE ACCTINQO before populating output fields.
23. A stopper field is an ASKIP (protected) field placed immediately after an input field. It prevents the cursor from overflowing into adjacent fields when the user types to the end of the input area. Without a stopper field, data can bleed into the next field on the screen, corrupting the display and potentially causing data entry errors.
24. Sequence: (1) User types AINQ + Enter → (2) CICS looks up AINQ in PCT, finds program ACCTINQ → (3) CICS creates Task 1, loads ACCTINQ, sets EIBCALEN=0 → (4) Program sends map, issues RETURN TRANSID('AINQ') COMMAREA → (5) Task 1 ends, resources freed → (6) User sees screen, enters data, presses Enter → (7) CICS creates Task 2, loads ACCTINQ, passes COMMAREA, sets EIBCALEN=n → (8) Program receives map, processes input, sends result, issues RETURN TRANSID COMMAREA → (9) Task 2 ends.
25. CICS tasks are expected to complete quickly (sub-second for online transactions) because they share a finite pool of resources with all other tasks. Long-running operations can cause resource shortages — thread exhaustion, storage depletion, and user timeout errors. Alternatives: (1) Use EXEC CICS START to trigger an asynchronous task for long-running work; (2) Submit a batch job via JES for very large operations; (3) Use a stored procedure for heavy database processing; (4) Break the work into multiple smaller CICS tasks using TSQ for intermediate state.