
WORKING-STORAGE SECTION changes
The allocation and management of WORKING-STORAGE SECTION have been changed since Enterprise COBOL V5. This does not affect the execution of the COBOL program. Tools or programs that need to locate the starting address of the WORKING-STORAGE SECTION might be affected. You can use the following method to locate the WORKING-STORAGE in Enterprise COBOL V5 and V6 programs at run time.
To find the start of WORKING-STORAGE in COBOL V5 and V6, you need to know how to locate the PPA4 (Program Prologue Area 4) in a dump.
How to find the PPA4 (Program Prolog Area 4) in a dump?
- Find the start of the program in the dump from the traceback.
- At the starting address + x'0C' is an offset value. This is the offset to the PPA1 from the start of the program.
- Starting address + PPA1 offset = PPA1.
- Go there in the dump.
- At PPA1 + x'04' is an offset value. This is the offset to the PPA2 from the start of the program.
- Starting address + PPA2 offset = PPA2.
- Go there in the dump.
- At PPA2 + x'08' is an offset value. This is the offset to the PPA4 from the PPA2 address.
- PPA2 + PPA4 offset = PPA4.
- Go there in the dump. You are now at the PPA4.
PPA4 layout
The major fields in PPA4 that you need are as follows:

Offset Length Description
X'08' 4 Address of NORENT static A(NORENTstatic)
X'0C' 4 Signed offset from WSA to 32-bit RENT static Q(RENTstatic)
X'10' 4 Signed offset from 32-bit RENT static to A(DATA24_31_address_cell-RENTstatic)
program static address cell.
Note: You need to dereference (get the value in storage at) the address cell to
get the address of the program static area.
X'14' 4 Offset of user code from PPA4 A(Code-PPA4)
X'18' 4 Length of user generated code Code Length
X'1C' 4 Length of NORENTstatic area Length NORENTstatic
X'20' 4 Length of RENTstatic area Length RENTstatic
X'24' 4 Length of DATA31 area Length DATA24_31
X'28' 4 Offset of program name from PPA4 A(CUName-PPA4)
X'2C' 4 Offset of WORKING-STORAGE (from Q(RENTstatic) or A(DATA24_31_address_cell-RENTstatic))
X'30' 4 Length of WORKING-STORAGE
X'34' 1 Byte with bit to indicate if the program has EXTERNAL data items

For information about each PPA4 offset, length, and description, see the COBOL V5 32-bit PPA4 layout table in the z/OS® Language Environment® Vendor Interfaces.
Next, you need to know some terminology.Terms to know
- NORENT static area
- This storage area is allocated in the executable for each program that was compiled with NORENT. A NORENT program’s WORKING-STORAGE will be located here.
- LE’s writable static area (WSA)
- Every COBOL V5 or V6 program object (executable) has this storage area.
- RENT static area
- This storage area is allocated inside the WSA for every program that is statically bound into the executable and compiled with RENT. Each program has their own RENT static area. A program’s WORKING-STORAGE may or may not be located here.
- Program static area
- This storage area is allocated outside of the WSA only if certain conditions are met. In those cases, the program’s WORKING-STORAGE will be located here, instead of in the RENT static area.
Next, you need to understand that there are three locations where WORKING-STORAGE can reside.
Explanation of the areas where WORKING-STORAGE can reside
- Inside the program object (executable). All programs compiled with the NORENT option have a NORENT static area reserved within the executable and WORKING-STORAGE resides here.
- All programs compiled with the RENT option have a RENT static area allocated inside LE’s WSA (writable static area). WORKING-STORAGE could reside here.
- Instead of being located in the RENT static area, some COBOL V5 or later RENT programs have their WORKING-STORAGE allocated outside of LE’s WSA, in an area called the program static area.
The picture below shows how storage is laid out for RENT programs whose WORKING-STORAGE resides in the program static area:
Program Object (Executable)
(Has two programs A & B statically bound.)
|-------------------------------------------|
| |
| LE’s WSA (writable static area) |
| |-------------------------------------| |
| | | |
| | | |
| | Program A - RENT static area | |
| | |-------------------------------| | |
| | | (Corresponds to the STATIC | | |
| | | MAP in Program A’s listing) | | |
| | |-------------------------------| | |
| | | |
| | | |
| | Program B - RENT static area | |
| | |-------------------------------| | |
| | | (Corresponds to the STATIC | | |
| | | MAP in Program B’s listing) | | |
| | |-------------------------------| | |
| | | |
| | | |
| |-------------------------------------| |
| |
| |
| |
| Program A – program static area |
| |-------------------------------------| |
| | (Corresponds to the WORKING-STORAGE | |
| | MAP (or the WSA 24 MAP) in | |
| | Program A’s listing) | |
| |-------------------------------------| |
| |
| |
| Program B – program static area |
| |-------------------------------------| |
| | (Corresponds to the WORKING-STORAGE | |
| | MAP (or the WSA 24 MAP) in | |
| | Program B’s listing) | |
| |-------------------------------------| |
| |
|-------------------------------------------|
Once
you understand the three areas where WORKING-STORAGE could reside,
you need to know how to determine where a program’s WORKING-STORAGE
actually does reside. How to determine the area where WORKING-STORAGE is located?
COBOL versions | Compiler options | Where is WORKING-STORAGE located? |
---|---|---|
COBOL V5 | NORENT | In the program's NORENT static area |
RENT, DATA(31) | In the program's RENT static area inside the WSA | |
RENT, DATA(24) or RENT, WSOPT1 | In the program's program static area outside the WSA | |
COBOL V6 or later versions | NORENT | In the program's NORENT static area |
RENT, DATA(31) & SPANNED RECORDS (i.e. the WSOPT bit is OFF)2 | In the program's RENT static area inside the WSA | |
RENT, DATA(24) (i.e. the WSOPT bit is ON)2 | In the program's program static area outside the WSA | |
RENT, DATA(31) & NO SPANNED RECORDS (i.e. the WSOPT bit is ON)2 | In the program's program static area outside the WSA | |
Notes:
|
How to find WORKING-STORAGE in a dump?
What to find? | How to find it in a dump? |
---|---|
PPA4 | See the instructions above. |
NORENT static area | The address is located in storage at <PPA4 + x'08'> |
LE’s WSA | The address is located in storage at <CEECAA
(or R12) + x'1F4'>. This is called CEECAARENT in a dump. |
RENT static area | The address is located in storage at <The address in storage at CEECAA (or R12) + x'1F4'> + <the offset in the program’s PPA4 + x'0C'> |
Program static area | The address is located in storage at <The address in storage at CEECAA (or R12) + x'1F4’> + <the offset in the program’s PPA4 + x'0C'> + <the offset in the program’s PPA4 + x'10'> |
Once you find these areas in a dump, then you can compare that to the compile listing.
- The STATIC MAP shows the layout of the RENT static area or the NORENT static area.
- The WORKING-STORAGE MAP or the WSA 24 MAP shows the layout of the program static area.
Use the LE vendor interface IGZXAPI to query the WORKING-STORAGE address
The COBOL-specific vendor interface routine, IGZXAPI, can also be used to query the WORKING-STORAGE address. With Enterprise COBOL V6.1, the LE vendor interface IGZXAPI is enhanced with new function code 8 to request information about the WORKING-STORAGE SECTION length and address for a COBOL program. The returned address corresponds to the STATIC MAP section in the COBOL compiler listing. Other information, such as the program name from PROGRAM-ID and signature information bytes (correspond to the “Compiler Options and Program Information Section” of the compiler listing), are also returned.
This enhancement is introduced in COBOL Runtime LE PTF for APAR PI49703. For more information about IGZXAPI, see IGZXAPI in the z/OS Language Environment Vendor Interfaces.
Example: Program prolog areas (Enterprise COBOL for z/OS Programming Guide)
Common interfaces and conventions (z/OS Language Environment Vendor Interfaces)
