Chapter 3 Exercises: Language Environment Internals
Part A: Conceptual Questions
A1. Explain what Language Environment provides to a COBOL program. List five specific services and explain why a COBOL program cannot execute without LE on z/OS.
A2. Describe the LE initialization sequence from the moment the z/OS program loader transfers control to the load module's entry point until the first PROCEDURE DIVISION statement executes. Identify at least six steps in the sequence.
A3. Define "enclave" and "thread" in LE terminology. How many enclaves typically exist per batch job step? How many per CICS region? Why is this distinction important for storage management?
A4. Explain the runtime option priority chain: CEEUOPT, PARM, CEECOPT/CEEDOPT, LE defaults. Why does CEEUOPT have the highest priority? What problems can arise when options are set at multiple levels?
A5. Compare TRAP(ON) and TRAP(OFF). What specifically does LE register with z/OS when TRAP(ON) is in effect? What diagnostic information is lost when TRAP(OFF) is set?
A6. Explain the difference between ABTERMENC=ABEND and ABTERMENC=RETCODE. In what environments is each appropriate? Why does Yuki Nakamura at SecureFirst use RETCODE for API-invoked COBOL programs?
A7. Describe how LE condition handling processes a hardware interrupt (e.g., S0C7). Trace the path from the hardware interrupt through z/OS, through LE, to the CEEDUMP and program termination.
A8. Explain why dynamic CALL without CANCEL can cause a storage leak in a long-running batch program. What happens to the subprogram's working storage on each invocation?
Part B: Applied Analysis
B1. CEEDUMP Interpretation
A CEEDUMP from a production batch failure shows:
CEE3DMP V2 R5.0: Condition processing resulted in the unhandled condition.
03/15/2023 02:47:12
Information for enclave CNBPOST1
Information for thread 8000000000000001
Traceback:
DSA Entry E Offset Statement Load Module Status
1 CEEPLPKA +00000000 CEEPLPKA Call
2 CNBPOST1 +0000831C 006104 CNBPOST1 Exception
3 CNBVLDT5 +00002A10 002347 CNBPOST1 Call
4 CNBPOST1 +00005E48 004522 CNBPOST1 Call
5 CEEMAIN +00000124 CEEPLPKA Call
Condition Information for Active Routines:
Condition:
CEE3207S The system detected a protection exception
(System Completion Code=0C4).
Location:
Program Unit: CNBPOST1
Entry: CNBPOST1
Statement: 6104
Offset: +0000831C
a) Trace the call chain from the bottom of the traceback to the exception. Which program is the main program? Which is the subprogram?
b) At which statement in which program did the failure occur?
c) The failure is an S0C4 (protection exception). List the three most likely COBOL coding errors that would cause this at statement 6104.
d) What additional information would you need from the compile listing to complete the diagnosis?
e) If the statement at 6104 is MOVE WS-DATA(WS-IDX) TO WS-OUTPUT, what is the most likely root cause?
B2. Runtime Option Conflict Resolution
A COBOL program at Pinnacle Health Insurance has the following LE option sources:
CEEUOPT (linked with program):
HEAP=(2097152,1048576,ANYWHERE,KEEP,67108864,33554432)
TRAP=(ON,SPIE)
ALL31=ON
JCL PARM:
PARM='/HEAP(32768,32768,ANYWHERE,KEEP,8192,4096),RPTSTG(ON)'
CEEDOPT (installation defaults):
HEAP=(32768,32768,ANYWHERE,KEEP,8192,4096)
STACK=(131072,131072,ANYWHERE,KEEP,524288,131072)
STORAGE=(NONE,NONE,NONE)
TRAP=(ON,SPIE)
RPTSTG=OFF
a) For each option, determine which source "wins" (has the highest priority).
b) What is the effective HEAP setting? Is it the 2 MB from CEEUOPT or the 32 KB from PARM?
c) What is the effective STORAGE setting? Is this a problem?
d) What is the effective RPTSTG setting? Which source set it?
e) Diane Okoye wants STORAGE(00,FE,00) for all programs. Where should she configure it to ensure it applies even when CEEUOPT doesn't specify STORAGE?
B3. LE Initialization Failure Analysis
Kwame's team encounters the following LE abend codes in a single week:
| Day | Program | Abend | Environment |
|---|---|---|---|
| Monday | CNBAR300 | U4038 | CICS |
| Tuesday | CNBRPT50 | U4039 | Batch |
| Wednesday | CNBVAL20 | S80A during LE init | Batch |
| Thursday | CNBAR300 | U4038 | CICS (different AOR) |
| Friday | CNBPOST1 | U4093 | CICS |
a) What is the most likely root cause for the U4038 on Monday and Thursday? Why did it appear in different AORs?
b) What caused the U4039 on Tuesday? What diagnostic step would you take?
c) The S80A during LE initialization on Wednesday — at which step in the initialization sequence did it fail? What distinguishes this from an S80A during program execution?
d) The U4093 on Friday — what type of initialization failure does this represent?
e) Is there a systemic issue? What change might have triggered all five failures in one week?
B4. Enclave Lifecycle in CICS
A CICS AOR processes 500 transactions per second. Each transaction: 1. Receives input from a TN3270 terminal 2. CALLs three subprograms (SUB-A, SUB-B, SUB-C) 3. Performs two DB2 queries 4. Sends output to the terminal
a) How many LE enclaves are created per second?
b) How many LE enclaves are created per hour?
c) What is the average enclave lifetime if each transaction takes 15ms?
d) Why does the preinitialized LE environment in CICS matter given this volume?
e) If each enclave creation involved full LE initialization (CEEMAIN → option resolution → heap/stack allocation), estimate the overhead per transaction. Use 500 microseconds as the full initialization time. What percentage of the 15ms transaction time would LE initialization consume?
B5. STORAGE Option Debugging
A COBOL program at Federal Benefits Administration is producing incorrect output intermittently. Marcus Whitfield suspects an uninitialized working storage field. The current LE configuration has STORAGE(NONE,NONE,NONE).
a) How would changing to STORAGE(00,FE,00) help diagnose the problem?
b) What pattern would you look for in the data output if a field is uninitialized with STORAGE(NONE,NONE,NONE)?
c) What pattern would you look for if a field contains X'FE' bytes under STORAGE(00,FE,00)?
d) The program works in QA but fails in production. QA has STORAGE(00,00,00). What difference in storage initialization behavior might explain the intermittent production failure?
e) Design a diagnostic test plan using LE runtime options to isolate the uninitialized field.
B6. Cross-Environment LE Configuration
Carlos Vega at SecureFirst Retail Bank has a COBOL program (SFXFER01) that runs in three environments: 1. Batch (nightly reconciliation) 2. CICS (real-time funds transfer) 3. z/OS Connect (REST API for mobile app)
a) For each environment, specify the appropriate ABTERMENC setting and explain why.
b) For each environment, specify the appropriate CEEDUMP setting and explain why.
c) Can a single CEEUOPT serve all three environments? If not, how many CEEUOPT modules does Carlos need?
d) What LE options are controlled by CICS and cannot be set in CEEUOPT for the CICS environment?
e) How should RPTSTG be managed across the three environments? (Consider: batch runs once nightly, CICS runs millions of transactions, z/OS Connect handles 5,000 API calls per second.)
Part C: Configuration and Design
C1. Write a CEEUOPT assembler source module for a high-volume batch COBOL program that: - Processes 50 million records - Calls 12 subprograms dynamically - Has 800 MB of working storage - Is compiled with LP(64) - Runs in the EOD critical batch window
Specify and justify each runtime option.
C2. Write a CEECOPT configuration for a CICS environment that: - Handles 2,000 concurrent tasks - Runs programs from three different compiler eras (V4, V5, V6) - Must produce diagnostic information for abends without consuming excessive temp storage - Must protect against uninitialized data bugs
Specify and justify each option.
C3. Design an RPTOPTS verification procedure. Given the RPTOPTS output for a program, create a checklist that an architect would use to verify that all runtime options are correctly configured. Include: - Which options to check - Expected values for each - Common misconfigurations to look for - Escalation procedure for mismatches
C4. Create a decision tree for LE abend diagnosis:
Starting from "Program abended with Uxxxx": - If U4038: → (steps) - If U4039: → (steps) - If U4093: → (steps) - If S80A during init: → (steps) - If other Uxxxx: → (steps)
For each path, specify: (a) what to check first, (b) what data to collect, (c) likely root cause, (d) fix.
Part D: Production Scenarios
D1. A z/OS upgrade from 2.5 to 3.1 is scheduled for next month at CNB. The upgrade includes an LE upgrade. Kwame needs to assess the risk to all production COBOL programs. Describe: a) How to identify which programs are at risk of U4038 b) How to prioritize testing (what programs to test first) c) What the testing procedure should include d) What rollback plan to have if LE incompatibilities are found post-upgrade
D2. Pinnacle Health Insurance's batch job PNCLM700 has been running with TRAP(OFF) for three years. Nobody knows why. Diane Okoye wants to change it to TRAP(ON). Ahmad Rashidi asks: "What are the risks of changing a runtime option on a program that's been stable for three years?" Answer Ahmad's question comprehensively.
D3. A developer at SecureFirst Retail Bank creates a COBOL program with 200 lines of LOCAL-STORAGE SECTION. The program is called via dynamic CALL from a main program that processes 5 million records. Each invocation of the subprogram allocates LOCAL-STORAGE on the LE stack. Estimate the stack storage consumption and determine whether the default STACK runtime option is sufficient.
Part E: Architecture Problems
E1. Design a CEEDUMP-to-ticket automation system. When a CICS COBOL program abends and produces a CEEDUMP: a) How would you capture the CEEDUMP text? b) How would you extract the traceback, statement number, and condition code automatically? c) How would you create a support ticket with the extracted information? d) What LE and CICS configuration is needed to support this automation?
E2. Sandra Chen needs to create an LE compatibility matrix for Federal Benefits Administration's 340 COBOL programs. Design the matrix: a) What columns should it have? b) How would you populate it (what data sources)? c) How would you use it to plan z/OS upgrades? d) How would you maintain it as programs are recompiled?
E3. Design an LE runtime option governance framework for an organization with 500+ COBOL programs across batch, CICS, and API environments. Include: a) Standard CEEUOPT templates (one per environment type) b) Exception process (when a program needs non-standard options) c) Verification process (how to confirm options are correctly applied) d) Monitoring process (how to detect option drift over time)
Part M: Mixed Practice (Spaced Review of Chapters 1-2)
M1. In Chapter 1, you learned that the z/OS dispatcher uses a priority scheme with 256 levels. When LE initializes a COBOL program (Section 3.2), the program runs on a TCB within the batch initiator address space. How does WLM determine the dispatching priority for this TCB? Does LE have any influence on the dispatching priority?
M2. Chapter 2 described the S80A abend as "out of virtual storage in the user region." Section 3.2 of this chapter describes S80A during LE initialization. Using both chapters, explain: (a) at which initialization step does the S80A occur, (b) is it the HEAP or WORKING-STORAGE GETMAIN that typically fails, (c) how does the RPTSTG report help prevent this failure.
M3. In Chapter 2, you calculated region sizes for batch programs. In this chapter, you learned about CEEUOPT and PARM-based LE configuration. Reconcile these: when you calculate "LE runtime libraries (~25 MB)" as part of the region size formula, which specific LE modules are consuming that storage? How does the HEAP initial size in your CEEUOPT affect the region size calculation?
M4. Chapter 1 described the Parallel Sysplex with four LPARs at CNB. Each LPAR has its own LE installation (CEEDOPT, CEECOPT). What happens if LPAR CNBPROD1 has STORAGE(00,FE,00) in CEEDOPT but CNBPROD3 has STORAGE(NONE,NONE,NONE)? A batch job that normally runs on CNBPROD1 is routed to CNBPROD3 by JES2. How might this affect program behavior?
M5. Chapter 2's Case Study 2 described Pinnacle Health Insurance's CICS SOS condition. Using the LE concepts from this chapter, explain: (a) how does LE enclave creation for each CICS task contribute to DSA consumption, (b) what LE overhead exists per task beyond the COBOL working storage, (c) how does the CICS preinitialized LE environment reduce per-task LE overhead.