IGZXAPI — COBOL file and runtime information query routine
Purpose
IGZXAPI is a loadable module that can be called to query information about a running
COBOL program. Following is sample code for calling the routine:
LOAD EP=IGZXAPI
..
LA R1,[parm area]
BALR R14,R15
..
[parm
area] is an array of addresses. Only the first address entry is used. This address must
point to one of the XINFO DESCT parameter blocks described in this topic. For example, use XINFO3
DESCT to get the Writable Static Area (WSA)).
To call the routine under CICS, you can use the following sample
code:
EXEC CICS LOAD PROGRAM ('IGZXAPI ')
SET ([load_addr])
ENTRY ([ep_addr])
...
L R15,[ep_addr]
LA R1,[parm area]
BALR R14,R15xx
[parm
area] is an array of addresses. Only the first address entry is used. This address must
point to one of the XINFO DESCT parameter blocks described in this topic. For example, use XINFO3
DESCT to get the Writable Static Area (WSA)).
In AMODE 31
, the routine can also be called statically. The static entry
point name is IGZXAPS. Include the data set SCEELKED in the SYSLIB DD when link-editing your program
to this static entry point.
In this description, a DSECT is also known as an "information structure".
Syntax
void IGZXAPI
- R1 (input)
- Points to the parameter area.
- R13 (input)
- Points to a save area.
- R14 (input)
- Is the return address.
- R15 (input)
- Is the entry point address of IGZXAPI.
- (output)
- The data structure (XINFO or XINFO8) is populated. Registers R2-R14 remain unchanged.
R15 (output)
Is the return code upon return from the routine. The following table lists the possible return
codes and their descriptions.
Return code Description -1 COBOL internal control areas are corrupted. For function code 1 and 4, this means that the FileControl Block is corrupted. -2 COBOL internal file information area is corrupted. -3 The length of the input parameter information structure is too short. -4 The input DSA does not belong to a program compiled with COBOL V5 or later compilers. -5 The input Entry Point is invalid, or does not belong to a program compiled with COBOL V5 or later compilers. -6 COBOL internal control area associated with the program to be queried is corrupted.
-11
COBOL internal control area associated with the dynamic-length elementary item to be queried
is corrupted.
-12
Pointer to XINFO structure is zero.
-13
For XINFO12, the XSRAD12Q or XSRAD12X field is zero.
-99 The function code is not valid. 0 The call returns successfully. 1 The file to be queried or updated is not found. 
If IGZXAPI is entered in AMODE 31, the layouts of the information structure are
shown under Layout of the information structure for AMODE 31. The COBOL program to be queried should be
AMODE 31. If IGZXAPI is entered in AMODE 64, the layouts of the information structure are shown
under Layout of the information structure for AMODE 64. The COBOL program to be queried should be AMODE
64.
For AMODE 64, the save area pointed to by R13 is 144 bytes. There are additional
requirements for a work area
.
File information query
To query file information of a running COBOL program (language member identifier 4).
- XNREST
- This is the number of files remaining to be returned from the query.
- XNFILES
- This is an output field, and indicating the total number of files. This is returned by the routine in the first call, and remains unchanged in subsequent calls.
XDSA (AMODE 31 only)
- This is the DSA address of the COBOL program being queried. This is set by the caller in the first call, and must not be modified in subsequent calls.
- XLEN
Length of the XINFO data structure. For AMODE 31, caller should
set this field to the length of XINFO, 120. For AMODE 64, caller should set this field to 160.
- XFNCODE
- This is the function code. Set to 1 by caller for file information query.
XPROGEP (AMODE 64 only)
Entry point address of the COBOL program being queried. Set by the caller.
XPSTACK (AMODE 64 only)
Address of the current XPLINK stack (with 2048-bytes bias). This could be the DSA of the COBOL
program being queried, or that of a routine called directly or indirectly by the COBOL program. Set
by the caller.
XCAA (AMODE 64 only)
Address of the Language Environment CAA control block containing the COBOL program. Set by the
caller.
XWKAREA (AMODE 64 only)
Address of a 2048-bytes work area provided by the caller (for use by IGZXAPI). This work area
can be allocated anywhere, above or below the bar.
SD files are not physical data files. They do not exist until the sort is active. The current sort
record, if present, is provided by way of the runtime information query (in XINFO2).
Runtime information query
XDSA2 (AMODE 31 only)
- The DSA address of the COBOL program to be queried.
- XLEN2
- Length of XINFO2.
- XFNCODE2
- This is the function code. Set to 2 for general runtime information query.
XEP2 (AMODE 64 only)
Entry point address of the COBOL program being queried. Set by the caller.
XPSTACK2 (AMODE 64 only)
- Address of the current XPLINK stack (with 2048-bytes bias). This could be the dsa of the COBOL program being queried, or that of a routine called directly or indirectly by the COBOL program. Set by the caller.
XCAA2 (AMODE 64 only)
Address of the Language Environment CAA control block containing the COBOL program. Set by the
caller.
XWKAREA2 (AMODE 64 only)
Address of a 2048-bytes work area provided by caller (for use by IGZXAPI). This work area can be
allocated anywhere, above or below the bar.
Language Environment writable static area (WSA) address query
Language Environment WSA
address of a given entry point. DSECT
XINFO3 is the information structure to communicate with the
WSA
address query
routine. On input: - XEP3
- The entry point address of the COBOL program to be queried.
- XLEN3
- Length of XINFO3.
- XFNCODE3
- This is the function code. Set to 3 for WSA address query.
XPSTACK3 (AMODE 64 only)
Address of the current XPLINK stack (with 2048-bytes bias). This could be the DSA of the COBOL
program being queried, or that of a routine called directly or indirectly by the COBOL program. Set
by the caller.
XCAA3 (AMODE 64 only)
Address of the Language Environment CAA control block containing the COBOL program. Set by the
caller.
XWKAREA3 (AMODE 64 only)
Address of a 2048-bytes work area provided by the caller (for use by IGZXAPI). This work area
can be allocated anywhere, above or below the bar.
R12 (AMODE 31 only)
Register 12 points to the Language Environment CAA which contains the COBOL
program.
File status update
XDSA4 (AMODE 31 only)
- The DSA address of the COBOL program.
- XLEN4
- Length of XINFO4.
- XFNCODE4
- This is the function code. Set to 4 for file status update.
XEP4 (AMODE 64 only)
Entry point address of the COBOL program being queried. Set by the caller.
XPSTACK4 (AMODE 64 only)
Address of the current XPLINK stack (with 2048-bytes bias). This could be the DSA of the COBOL
program being queried, or that of a routine called directly or indirectly by the COBOL program. Set
by the caller.
XCAA4 (AMODE 64 only)
Address of the Language Environment CAA control block containing the COBOL program. Set by the
caller.
XWKAREA4 (AMODE 64 only)
Address of a 2048-bytes work area provided by the caller (for use by IGZXAPI). This work area
can be allocated anywhere, above or below the bar.
- XFILENM
- COBOL FD name of the file.
- XFSTATUS
- Address of the buffer area containing the new file status data.
- XFSLEN
- Length of the XFSTATUS buffer area.
R12 (AMODE 31 only)
Register 12 points to the Language Environment CAA, which contains the COBOL
program.
COBOL Program WORKING STORAGE Query routine
V5+ (V5 or later
releases)
program given its entry point or a DSA address
(AMODE 31 only)
.
DSECT XINFO8 is the information structure to communicate with the routine. This routine can also be
used with a callback when the entry point is not in the current address space. However, the callback
is used only if either an entry point or DSA address is explicitly specified in XINFO8. On input: - XEP8
- Optional
for AMODE 31
. The entry point address of the COBOL program to be
queried.
For AMODE 64, this field must be specified.
- XDSA8
-
For AMODE 31:
- Optional. The DSA address of the COBOL V5+ program to be queried, or of a non-COBOL V5+ program
called by the COBOL V5+ program. The DSA will only be considered if XEP8 is set to 0. The default of
XDSA8 is the DSA of the program calling IGZXAPI. If both XEP8 and XDSA8 are set to 0, this routine
will use the XDSA8 default.
If the DSA address belongs to a COBOL V5+ program, the WORKING-STORAGE section information of this program will be returned. Otherwise, this routine will traverse the DSA back chain to locate the entry point address of the nearest COBOL V5+ program. The query will then be applied to this program.
If the XDSA8 default is used, XCBACK8 (see following entry) will be ignored.
For AMODE 64:
Address of the current XPLINK stack (with 2048-bytes bias). This could be the DSA
of the COBOL program being queried, or that of a routine called directly or indirectly by the COBOL
program.
- XLEN8
- Length of XINFO8.
For AMODE 31
, caller should set this to 92.
For AMODE 64, caller should set this to 168.
Caller should provide memory for this
data structure. - XFNCODE8
- Set to 8 for WORKING-STORAGE query.
XCAA8 (AMODE 64 only)
Address of the Language Environment CAA control block containing the COBOL program.
- XCBACK8
- Optional. When specified, it is the address of a callback function. This is required when the
given entry point (XEP8, see above) or DSA (XDSA8, see above) is not in the current address space of
the caller doing the query. In this case, IGZXAPI may not have access to the COBOL program. It will
call the callback function to do storage accesses. The usage and prototype of this callback function
is the same as the callback_p parameter in Language Environment's __fnwsa function.
It is entered in the same AMODE when IGZXAPI is called. On entry, R13 points to a save area of 72
bytes (for AMODE 31) or 144 bytes (for AMODE 64). R1 points to a parameter area with the following
equivalent function
prototype:

void * (*callback_p)(void* data_p, size_t data_l); data_p – Pointer to the start of the required data. data_l – The number of bytes of data required. data_l will never exceed 16 bytes. If (*callback_p)() cannot pass back the complete data requested, it must not return to this routine.
Set
this field to zero if callback function is not required.
R12
(AMODE 31 only)
– Register 12 points to the Language Environment CAA of
the Enclave containing the COBOL program. Otherwise, register 12 must be set to 0.
DSA - The DSA backchain must be chained correctly back to a Language Environment conforming DSA when this routine receives control.
All other fields are output from the routine.
The address returned in XWSTOR8 is where the WORKING-STORAGE section resides. This can either be XSA8, XS24A8, or XNORENT8. The corresponding length is in XWSLEN8.
XSA8, XS24A8,
XS31A8 (AMODE 64 only)
and XNORENT8
(AMODE
31 only)
provide additional information about the WORKING-STORAGE section and its
correspondence with the compilation listing. These fields are not needed to locate the
WORKING-STORAGE section, as its address is always returned in XWSTOR8. The additional information
can be useful when, for example, analyzing a dump.
The address returned in XSA8 corresponds to the INITIAL HEAP STORAGE MAP section, also know as the STATIC MAP section, in the compilation listing. The length of this area is in XSALEN8.
(also known as WORKING-STORAGE MAP or WS MAP depending upon the COBOL releases)
in the
compilation listing. The length of this area is in XS24LEN8. If there is no WSA 24 MAP, these two
fields are set to zero. If the program is compiled with the NORENT option, the address returned in XNORENT8 corresponds to the STATIC MAP section in the compilation listing. The length is in XNORLEN8.
WSIBYTE8 is the address of the Signature Information Bytes (INFO. BYTES) of the COBOL program. This corresponds to the constants shown in the “Compiler Options and Program Information Section” in the compilation listing.
WSOPT is a bit within the Signature Information Bytes. It is located at decimal byte
offset 15, bit 3. This bit is used only in AMODE 31. 
XWSA8 is the address of the WSA.
This routine also returns the name of the COBOL
V5+
program. The address of
the program name is returned in XPNAME8 and the corresponding length in XPNALEN8.
All addresses returned in the output fields are in the same address space as the entry point
address of the COBOL
V5+
program.
The calling convention is the same as the file information routine.
Additional requirements for AMODE 64: - If this routine (Working Storage Query Routine) is called multiple times, the same XINFO8 parameter area must be passed back to the routine. Except for input fields, do not modify any other fields from the previous call. Clear all fields to binary zero before making the first call.
- XCBACK8. This points to a routine for querying data in storage. On entry, the AMODE is AMODE 64:
- R13 points to a save area of 144 bytes
- R1 points to the parameter area, which is an array of doublewords. The first double word contains the address of the requested data. The second doubleword contains an integer that is the length of the data. The address of the retrieved data is returned in R15.


WORKING-STORAGE location
| COBOL version | Compiler option | WORKING-STORAGE location |
|---|---|---|
| COBOL V5 | NORENT | NORENT static area |
| RENT, DATA(31) | RENT static area inside the WSA (above the line) | |
| RENT, DATA(24) or RENT, WSOPT (see note #1) | Program static area outside the WSA (below the line) | |
| COBOL V6 or later versions | NORENT | NORENT static area |
| RENT, DATA(31) and SPANNED RECORDS with ‘SAME RECORD AREA’ clause (the WSOPT bit is OFF) (see note #2) | RENT static area inside the WSA (above the line) | |
| RENT, DATA(24) (the WSOPT bit is ON) (see note #2) | Program static area outside the WSA (below the line) | |
| RENT, DATA(31) and NO SPANNED RECORDS (the WSOPT bit is ON) (see note #2) | Program static area outside the WSA (above the line) |
- In COBOL V5, there is a WSOPT compiler option. In COBOL V6, there is no longer a WSOPT compiler option, but rather a signature information bit for WSOPT that is automatically set by the compiler.
- For SPANNED RECORDS, the WSOPT signature information bit is OFF. For NO SPANNED RECORDS, the
WSOPT signature information bit is ON.
- You can scan your programs for 'RECORDING MODE S’ to determine if SPANNED RECORDS are used.
- Another alternative is to check the signature information bytes in the listing for the WSOPT
bit, which is signature byte 8, bit 3. For example, take the following from a listing:
=X'001000000000' INFO. BYTES 7-12Byte 8 is x'10', which is b'00010000'. Numbering the bits from left to right as 01234567, because bit 3 is on, WSOPT is on.


Layout of the Language Environment WSA, STATIC, PROGRAM STATIC, and User Working Storage
The layout, name and order of the COBOL control blocks and the compiler generated internal variables, such as BLT_Ptrs, GPCB, or JNIENVPTR, are subject to change and may vary, depending upon the COBOL compiler releases.
- If DATA(24) or WSOPT bit is ON, use the following layout:
- WSOPT bit is bit 3 at INFO.BYTE8 (INFO.BYTES + 15(0x0E)).
- DATA(31) bit is bit 2 at INFO.BYTE1 (INFO.BYTES + 8(0x08)). DATA(24) is in effect if the DATA(31) bit is off.
Figure 1. Layout of the COBOL V5+ RENT program (when DATA(24) or WSOPT bit is ON) (Also known as WSA24, Data cell, or HEAP) XWSA8-> _Language Environment WSA____ +-> _PROGRAM STATIC______ <-XS24A8 | ... | | | _WORKING-STORAGE_ |<-XWSTOR8 XSA8->| _RENT STATIC(Initial HEAP)_ | | | | o JNIENVPTR | | || o BLT_Ptrs || | | | o RETURN-CODE | | || o GPCB || | | | o ... | | || o ... || | | | _UsrWorkStrg_ | | || o ...-BASE-ADDRESS-----------+ | | | o X, Y, ... | | | ||___________________________|| | | |_____________| | | |_____________________________| | |_________________| | |_____________________|Note: PROGRAM STATIC and WORKING-STORAGE are the same. - if DATA(31) is ON and SPANNED RECORD with ‘SAME RECORD AREA’ clause, use the following layout:
Figure 2. Layout of the COBOL V5+ RENT program (when DATA(31) is ON and SPANNED RECORD with ‘SAME RECORD AREA’ clause) XWSA8-> _Language Environment WSA____ | ... | (Also known as XSA8->| _RENT STATIC(Initial HEAP)_ | WSA24, Data cell, or HEAP) XWSTOR8->|| _WORKING-STORAGE_____ || +-> _PROGRAM STATIC______ <-XS24A8 || | o BLT_Ptrs | || | | o <Compiler internal| || | o JNIENVPTR | || | | same record area> | || | o RETURN-CODE | || | | | || | o ... | || | | | || | _UsrWorkStrg_____ | || | |_____________________| || | | o X, Y, ... | | || | || | |_________________| | || | || | o GPCB | || | || | o ...-BASE-ADDRESS---------+ || |_____________________| || ||___________________________|| |_____________________________|Note: RENT STATIC(Initial HEAP) and WORKING-STORAGE are the same. - For all other cases , use the following layout:
Figure 3. Layout of the COBOL V5+ RENT program XWSA8-> _Language Environment WSA____ | ... | * XS24A8 is 0 XSA8->| _RENT STATIC(Initial HEAP)_ | XWSTOR8->|| _WORKING-STORAGE_____ || || | o BLT_Ptrs | || || | o JNIENVPTR | || || | o RETURN-CODE | || || | o ... | || || | _UsrWorkStrg_____ | || || | | o X, Y, ... | | || || | |_________________| | || || | o GPCB | || || | o ...-BASE-ADDRESS | || || |_____________________| || ||___________________________|| |_____________________________|Note: RENT STATIC(Initial HEAP) and WORKING-STORAGE are the same.
_COBOL PROGRAM_________________
| ... |
XNORENT8->| _NORENT STATIC(Initial HEAP)_ |
XWSTOR8->|| _WORKING-STORAGE_____ ||
|| | o BLT_Ptrs | ||
|| | o JNIENVPTR | ||
|| | o RETURN-CODE | ||
|| | o ... | ||
|| | _UsrWorkStrg_____ | ||
|| | | o X, Y, ... | | ||
|| | |_________________| | ||
|| | o GPCB | ||
|| | o ...-BASE-ADDRESS | ||
|| |_____________________| ||
||_____________________________||
|_______________________________|


Steps to locate the WORKING-STORAGE and User Working Storage(UsrWrkStrg) section of a 32-bit COBOL V5+ program
- From the entry point (EP) of the COBOL program, find PPA1, PPA2 and PPA4. Refer to Common interfaces and conventions for the layouts of these program prolog areas and their relationship with each other.
- The fields in PPA4 provide information about the starting point address of the WORKING-STORAGE section. For more information, refer to COBOL V5+ 32-bit PPA4 layout (with or without minor-version).
-
- If the program is compiled with the NORENT compiler option:The WORKING-STORAGE section is allocated in the NORENT static area.
- WORKING-STORAGE address = value in NORENTstatic, PPA4+X'08' .
- UsrWrkStrg address = WORKING-STORAGE address + value in Offset UsrWrkStrg in PPA4 .
- If the program is compiled with the RENT compiler option:The writable static area (WSA) is involved. The WSA is owned by a program object (PO). There is one WSA per PO. Within a PO, one or more COBOL programs can be statically linked together. Each of the programs contain a 32-bit RENT static area and a program static area.
- If the DATA(24) compiler option is in effect, or if the WSOPT bit is set, then the following
apply:
- WSA address = value in CEECAACRENT, CAA+X'1F4' .
- RENT STATIC address = WSA address + offset (value in RENTstatic, PPA4 + X'0C') .
- WS-BASE-ADDRESS = RENT STATIC address + offset (value in DATA address cell, PPA4+X'10') .
- WORKING-STORAGE address = value in WS-BASE-ADDRESS .
- UsrWrkStrg address = WORKING-STORAGE address + value in 'Offset Strasbourg' in PPA4 .
- For all other cases, the following apply:
- WSA address = value in CEECAACRENT, CAA+X'1F4' .
- RENT STATIC address = WSA address + offset (value in RENTstatic, PPA4+ X’0C’) .
- WORKING-STORAGE address = RENT STATIC address.
- UsrWrkStrg address = WORKING-STORAGE address + value in 'Offset Strasbourg' in PPA4 .
- If the DATA(24) compiler option is in effect, or if the WSOPT bit is set, then the following
apply:


Steps to locate the WORKING-STORAGE section of a 64-bit Enterprise COBOL program
- Find the entry point address of the program in the dump from the traceback. For example, in the
Language Environment CEEDUMP traceback, this is the address under the “E Addr” column corresponding
to the row of the program. In the following example, HELLO is the COBOL program. Its entry point address is X’260000A8’ and the start of the entry marker (XPLINK eyecatcher) is minus X’10’ from the entry point, X’26000098’. This address should contain the first executable instruction of the program (an STMG instruction).
Traceback: DSA Entry E Offset … 1 CEEHDSP +00003F3C 2 CELQHROD +00000266 3 HELLO +00000224 4 CELQINIT +00001D0C DSA DSA Addr E Addr 1 00000050082FBC60 0000000026B0A3D0 2 00000050082FEDA0 0000000026B1DD18 3 00000050082FEFA0 00000000260000A8 4 00000050082FF220 0000000026903010 - At program entry point offset -x’08’ (that is, X’260000A0’) is an offset value (4 bytes) from the start of the entry marker(that is, X’26000098’) to PPA1.
- At PPA1+x’04’ is an offset value (4 bytes) from start of PPA1 to PPA2.
- At PPA2+x’08’ is an offset value (4 bytes) from start of PPA2 to PPA4.
- At PPA4+x’7C’ is an offset value (8 bytes) from the environment of the program to the heap
storage address table. Note: Environment here refers to the XPLINK environment of the program. This is the address in register R5 on entry into the program. The first instruction of the program, the STMG, stores the register to the stack. The contents of R5 can be found in the dump.


Heap storage address table
Offset of this table from the environment of the program is in PPA4+X’7C’.
There are also COBOL control areas and compiler internal variables allocated in the above the bar heap. The first WORKING-STORAGE data item in the program may not reside right at the beginning. The offset of the first data item in the WORKING-STORAGE section of the program can be found in PPA4 offset +X’40’.


Layout of the heap storage address table
| Offset | Length | Description |
|---|---|---|
| X’00’ | 8 | Above the bar heap starting address for COBOL (64-bit storage area) |
| X’08’ | 8 | Reserved |
| X’10’ | 8 | Reserved |
| Description | Can be found in: |
|---|---|
| Offset of Heap-Storage-Address-Table from R5 | PPA4+x’7C’ |
| Starting address of WORKING-STORAGE | Heap-Storage-Address-Table + x'00' |
| Offset of first user 64-bit data item from WORKING-STORAGE | PPA4+x’40’ |
| Length of the area containing all user WORKING-STORAGE 64-bit data items | PPA4+x’48’ |


Dynamic-length elementary item (DLEI) attribute query
- XCAA11Q
- In AMODE 64, this is an input field. In AMODE 31, this field should be set to zero. It is the address of the Language Environment CAA control block containing the COBOL program.
- XWKA11Q
- In AMODE 64, this is an input field. In AMODE 31, this field should be set to zero. It is the address of a 2048 byte work area provided by the caller (for use within IGZXAPI). This work area can be allocated anywhere, above or below the bar.
- XIADR11Q (AMODE 64 only) , XIADR11X (AMODE 31 only)
- This is an input field. It is the address of the dynamic-length elementary item to be queried. In AMODE 31, the high 4 bytes of XIADR11Q should be set to zero.
- XCB11Q (AMODE 64 only) , XCB11X (AMODE 31 only)
- This is an input field. It is the address of the dynamic-length elementary item to be queried. In AMODE 31, the high 4 bytes of XIADR11Q should be set to zero.
- XCB11Q (AMODE 64 only) , XCB11X (AMODE 31 only)
- Optional. This is an input field, and when specified it is the address of a callback function.
This is required when the given DLEI address (XIADR11Q or XIADR11X) is not in the current address
space of the caller doing the query. In this case, IGZXAPI may not have access to the COBOL program.
IGZXAPI will call the callback function to perform storage accesses. The usage and prototype of this
callback function is the same as the callback_p parameter in Language Environment's __fnwsa
function. In AMODE 31, the high 4 bytes of XCB11Q should be set to zero. The callback function is entered in the same AMODE when IGZXAPI is called. On entry, R13 points to a save area of 72 bytes (for AMODE 31) or 144 bytes (for AMODE 64). R1 points to a parameter area with the following equivalent function prototype:
void * (*callback_p)(void* data_p, size_t data_l);
- data_p
- Pointer to the start of the required data.
- data_l
- The number of bytes of data required. data_l will never exceed 16 bytes. If
(*callback_p)()cannot pass back the complete data requested, it must not return to this routine.
Set this field to zero if a callback function is not required.
All fields below XCB11X are output fields from the routine.


Updating dynamic-length elementary items
This section describes how to update a dynamic-length elementary item.
The DSECT INFO12 is the information structure to communicate with the runtime information routine. Use INFO12 to copy data from the source buffer, pointed to by the XSRAD12Q/XSRAD12X field, to the dynamic-length elementary item pointed to by the XDLAD12Q/XDLAD12X field. The dynamic-length elementary item LIMIT may cause the data to be truncated. When calling the runtime information routine with INFO12, the call must be made from within the same Language Environment enclave as the COBOL program that contains the dynamic-length elementary item to be updated.
- XCAA12Q
- In AMODE64, this is an input field. In AMODE31, this field should be set to zero. It is the address of the Language Environment CAA control block containing the COBOL program.
- XWKA12Q
- In AMODE64, this is an input field. In AMODE31, this field should be set to zero. It is the address of a 2048 byte work area provided by the caller (for use within IGZXAPI). This work area can be allocated anywhere, above or below the bar.
- XDLAD12Q (AMODE64 only) / XDLAD12X (AMODE31 only)
- This is a input field. It is the address of the dynamic-length elementary item to be updated. In AMODE31, the high 4 bytes of XDLAD12Q should be zero.
- XSRAD12Q (AMODE64 only) / XSRAD12X (AMODE31 only)
- This is an input field. It is the address of the source buffer containing data to be copied into the dynamic-length elementary item. In AMODE31, the high 4 bytes of XSRAD12Q should be zero.
- XSRLN12Q (AMODE64 only) / XSRLN12X (AMODE31 only)
- This is an input field. It is the length, in bytes, of the source buffer data.


Layout of the information structure for AMODE 31

--------------------------------------------------------------------------------
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO DSECT
XFNCODE DS F Input: Function code, =1 for file information
XFILLER0 DS A reserved
XSIG DS F X'C0B00501'
XVER DS H Version of this information structure block
XLEN DS H Input: Length of this data structure, 124
XDSA DS A Input: DSA of COBOL program to be querired
*
XNFILES DS H Total number of files
*
XNFILES DS H Total number of files
*
* BNREST is input field during the first call, set it to zero;
* on return, contains the remaing number of files to go
*
XNREST DS H Input in first call, set to zero
*
XDCB DS A Address of DCB or ACB
XDDNAME DS A Address of DDNAME (8 characters)
XFNAME DS A Address of file name (30 characters)
*
XCFLAG1 DS X Compile time information flags
XSOPTNL EQU X'80' SELECT OPTIONAL
XRCDSPN EQU X'40' Record format spanned
XBLKED EQU X'20' Record format blocked
XLINAGE EQU X'10' Linage is specified
XLINFOOT EQU X'08' Linage FOOTING is specified
XLINTOP EQU X'04' Linage TOP is specified
XLINBOT EQU X'02' Linage BOTTOM is specified
XBUFUSE EQU X'01' Buffer usage indicator
*
XCFLAG2 DS X Compile time information flags
XEXTFILE DS X'80' External file
FILLER2 DS X Reserved
FILLER3 DS X Reserved
*
XORG1 DS X File Type
XVSAM EQU X'01' VSAM
XLSEQ EQU X'02' Line Sequential
XQSAM EQU X'03' QSAM
*
XORG2 DS X File Organization
XORGSEQ EQU X'01' Sequential
XORGIND EQU X'02' Indexed
XORGREL EQU X'03' Relative
*
XACCESS DS X File Access Mode
XACCSEQ EQU X'01' Sequential
XACCRAN EQU X'02' Random
XACCDYN EQU X'03' Dynamic
*
XRECFM DS X Record Format
XRECFIX EQU X'01' Fixed
XRECVAR EQU X'02' Variable
XRECUND EQU X'03' Undefined
*
XRFLAG1 DS X Run time information flags 1
XOPOPT EQU X'80' OPEN, missing optional file
XOPREV EQU X'40' OPEN REVERSED (valid when XOPENED)
XOPNOREW EQU X'20' OPEN, NO REWIND (valid when XOPENED)
XCLNOREW EQU X'10' CLOSE, NO REWIND (valid when XCLOSED)
XCLLOCK EQU X'08' CLOSE, LOCK (valid when XCLOSED)
XCLREMOV EQU X'04' CLOSE FOR REMOVAL (valid when XCLOSED)
XSOKACT EQU X'02' A successful action since OPEN
*
XRFLAG2 DS X Run time information flags 2
XPEND EQU X'20' OPEN or CLOSE pending
XSEOF EQU X'10' Previous READ hit end of file
XEOP EQU X'08' End of page
XMOPTNL EQU X'04' OPTIONAL FILE MISSING
XADVAFT EQU X'02' WRITE AFTER ADVANCING x LINES
XADVBEF EQU X'01' WRITE BEFORE ADVANCING x LINES
FILLER4 DS H Reserved
*
XFMODE DS X Current file mode
XOPENED EQU X'01' Opened
XCLOSED EQU X'02' Closed
XNEVERO EQU X'03' Never opened
*
XOMODE DS X Information about OPEN (valid when XOPENED)
XOPIN EQU X'01' OPEN INPUT
XOPOUT EQU X'02' OPEN OUTPUT
XOPIO EQU X'03' OPEN IO
XOPEXT EQU X'04' OPEN EXTENDED
*
XCMODE DS X Information about CLOSE (valid when XCLOSED)
XCLFILE EQU X'01' CLOSE
XCLUNIT EQU X'02' CLOSE REEL/UNIT
*
XLASTREQ DS X Last operation on file
XLASTRD EQU X'01' READ
XLASTWRT EQU X'02' WRITE
XLASTRWT EQU X'03' REWRITE
XLASTSTR EQU X'04' START
XLASTDLT EQU X'05' DELETE
XLASTOPN EQU X'06' OPEN
XLASTCLO EQU X'07' CLOSE
*
* Various LINAGE values
*
XLNLING DS F Linage
XLNFOOT DS F Linage footing
XLNTOP DS F Linage top
XLNBOT DS F Linage bottom
XLNCTR DS F Linage counter
*
* File Status
*
XFSTAT DS X File status, in 2 hex bytes
XVSMCOD DS X VSAM feedback code
XVSMRET DS X VSAM return code
XVSMFUNC DS X VSAM function code
*
XADVVAL DS F Write after/before advancing value
*
XRECLEN DS F Record length; max length for variable rec
XBLKLEN DS F Block size
XRECLAD DS A Address of address of record
XBUFAD DS A Address of buffer provided by DFSMS
*
XPNAME DS A Address of program name
XPNAMLEN DS H Program name length
FILLER5 DS H Reserved
*
FILLER6 DS 4F Reserved
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
--------------------------------------------------------------------------------
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO2 DSECT
XFNCODE2 DS F Input: Function code, =2 for RT information
FILLER10 DS A reserved
XSIG2 DS F X'C0B00501'
XVER2 DS H Version of this information structure block
XLEN2 DS H Input: Length of this data structure, 48
XDSA2 DS A Input: DSA of COBOL program to be querired
*
FILLER11 DS X Reserved
FILLER12 DS X Reserved
FILLER13 DS X Reserved
*
XRFLAG4 DS X Run Time Flags
XINSORT EQU X'02' Sort is active
XISMAIN EQU X'01' Program is main
*
XSDREC DS A Address of active sort record
XSDLEN DS F Sort record len
FILLER14 DS 4F Reserved
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
--------------------------------------------------------------------------------
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO3 DSECT
XFNCODE3 DS F Input: Function code, =3 for WSA address query
FILLER30 DS A reserved
XSIG3 DS F X'C0B00501'
XVER3 DS H Version of this information structure block
XLEN3 DS H Input: Length of this data structure, 40
*
XEP3 DS A Input: Entry point address of COBOL program
XWSA DS A Address of WSA
*
FILLER31 DS 4F Reserved
*
*
--------------------------------------------------------------------------------
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO4 DSECT
XFNCODE4 DS F Input: Function code, =4 for file status update
FILLER40 DS A reserved
XSIG4 DS F X'C0B00501'
XVER4 DS H Version of this information structure block
XLEN4 DS H Input: Length of this data structure, 76
*
XDSA4 DS A Input: DSA address of COBOL program
XFILENM DS CL30 File Name. COBOL FD name of the file.
FILLER42 DS CL2
XFSTATUS DS A Addr of buff containing new File Status data
XFSLEN DS F Length of XFSTATUS buffer
*
FILLER31 DS 4F Reserved
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO8 DSECT
XFNCODE8 DS F Input: Function code, =8 for static area query
FILLER80 DS A Reserved
XSIG8 DS F Eye-catcher (output)
XVER8 DS H Version of this information structure block (output)
XLEN8 DS H Input: Length of this data structure, 92
*
XEP8 DS A Input: Entry point address of COBOL program (optional)
XDSA8 DS A Input: DSA of COBOL program (optional)
XCBACK8 DS A Input: Address of the callback function (optional)
*
XSA8 DS A Address of RENT STATIC MAP (output)
XSALEN8 DS F Length of RENT STATIC MAP (output)
XS24A8 DS A Address of WSA 24 MAP (output) Note 1
XS24LEN8 DS F Length of WSA 24 MAP (output)
XNORENT8 DS A Address of NORENT Static Area (output)
XNORLEN8 DS F Length of NORENT Static Area (output)
XWSTOR8 DS A Address of WORKING-STORAGE section (output)
XWSLEN8 DS F Length of WORKING-STORAGE section (output)
XWSA8 DS A Address of CWSA (output)
XIBYTE8 DS A Address of Information Byte (output)
*
FILLER82 DS H Reserved
XPNALEN8 DS H Length of program name (output)
XPNAME8 DS A Address of program name (output)
*
FILLER81 DS 4F Reserved
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO11 DSECT
XFNCOD11 DS F Input: Function code, =11 for a dynamic
* length elementary item descriptor query
FILLR110 DS CL4 reserved
XSIG11 DS F X'C0B00603'(output)
XVER11 DS H Version of this structure block (output)
XLEN11 DS H Input: Length of this data structure, 128
XFLGS011 DS CL8 Reserved, set to zero by caller
FILLR111 DS CL8 Reserved, set to zero by caller
FILLR112 DS CL8 Reserved, set to zero by caller
XCAA11Q DS AD Input: AMODE64 Address of the LE CAA
* Set XCAA11Q to zero in AMODE31
XWKA11Q DS AD Input: AMODE64 Address of 2048 bytes work area
* Set XWKA11Q to zero in AMODE31
*
XIADR11Q DS AD Input: AMODE64 Address of DLEI
ORG XIADR11Q
DS CL4 Reserved
XIADR11X DS A Input: AMODE31 Address of DLEI
*
XCB11Q DS AD Input: AMODE64 Callback func pointer (optional)
ORG XCB11Q
DS CL4 Reserved
XCB11X DS A Input: AMODE31 Callback func pointer (optional)
*
XDLFL011 DS CL4 Reserved
FILLR113 DS CL4 Reserved
*
XBFLN11Q DS FD AMODE64 Length of data at XBFAD11Q (output)
ORG XBFLN11Q
DS CL4 Reserved
XBFLN11X DS F AMODE31 Length of data at XBFAD11X (output)
XMXSZ11Q DS FD AMODE64 Allocated buffer size (output)
ORG XMXSZ11Q
DS CL4 Reserved
XMXSZ11X DS F AMODE31 Allocated Buffer size (output)
XLIMT11Q DS FD AMODE64 DLEI LIMIT value (output)
ORG XLIMT11Q
DS CL4 Reserved
XLIMT11X DS F AMODE31 DLEI LIMIT value (output)
XBFAD11Q DS AD AMODE64 Address of data (output)
ORG XBFAD11Q
DS CL4 Reserved
XBFAD11X DS AL4 AMODE31 Address of data (output)
*
XDLVER11 DS H DLEI Version (output)
FILLR114 DS CL6 Reserved
XDLGRW11 DS H DLEI Growth factor (output)
FILLR115 DS CL6 Reserved
XDLFST11 DS F DLEI Initial allocation size (output)
FILLR116 DS CL4 Reserved
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO12 DSECT
XFNCOD12 DS F Input: Function code, =12 for moving data
* to a dynamic length elementary item.
FILLR120 DS CL4 reserved
XSIG12 DS F X'C0B00603' (output)
XVER12 DS H Version of this information structure block (output)
XLEN12 DS H Input: Length of this data structure, 108
XFLGS012 DS CL8 Reserved, set to zero by caller
XCAA12Q DS CL8 Input: AMODE64 Address of the LE CAA
* Set XCAA12Q to zero in AMODE31
XWKA12Q DS CL8 Input: AMODE64 address of 2048 byte work area
*
XDLAD12Q DS AD Input: AMODE64 Address of DLEI descriptor
ORG XDLAD12Q
DS CL4 Reserved
XDLAD12X DS A Input: Address of DLEI descriptor
XSRAD12Q DS AD Input: AMODE64 Address of source buffer
ORG XSRAD12Q
DS CL4 Reserved
XSRAD12X DS A Input: Address of source buffer
XSRLN12Q DS FD Input: AMODE64 Length of source buffer
ORG XSRLN12Q
DS CL4 Reserved
XSRLN12X DS F Input: Length of source buffer
FILLR123 DS CL56 Reserved, set to zero by caller
--------------------------------------------------------------------------------

Despite its name, WSA 24 MAP may not reside
below the line. The address in XS24A8 is not necessarily a 24-bit address.


Layout of the information structure for AMODE 64

* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO DSECT
XFNCODE DS F Input: Function code, =1 for file information
XFILLER0 DS A reserved
XSIG DS F X'C0B00501'
XVER DS H Version of this information structure block
XLEN DS H Input: Length of this data structure, 160
DS A Input: Set to zero (reserved)
*
XNFILES DS H Total number of files
*
* BNREST is input field during the first call, set it to zero;
* on return, contains the remaing number of files to go
*
XNREST DS H Input in first call, set to zero
*
XDCB DS A Address of DCB or ACB
XDDNAME DS A Address of DDNAME (8 characters)
XFNAME DS A Address of file name (30 characters)
*
XCFLAG1 DS X Compile time information flags
XSOPTNL EQU X'80' SELECT OPTIONAL
XRCDSPN EQU X'40' Record format spanned
XBLKED EQU X'20' Record format blocked
XLINAGE EQU X'10' Linage is specified
XLINFOOT EQU X'08' Linage FOOTING is specified
XLINTOP EQU X'04' Linage TOP is specified
XLINBOT EQU X'02' Linage BOTTOM is specified
XBUFUSE EQU X'01' Buffer usage indicator
*
XCFLAG2 DS X Compile time information flags
XEXTFILE DS X'80' External file
FILLER2 DS X Reserved
FILLER3 DS X Reserved
*
XORG1 DS X File Type
XVSAM EQU X'01' VSAM
XLSEQ EQU X'02' Line Sequential
XQSAM EQU X'03' QSAM
*
XORG2 DS X File Organization
XORGSEQ EQU X'01' Sequential
XORGIND EQU X'02' Indexed
XORGREL EQU X'03' Relative
*
XACCESS DS X File Access Mode
XACCSEQ EQU X'01' Sequential
XACCRAN EQU X'02' Random
XACCDYN EQU X'03' Dynamic
*
XRECFM DS X Record Format
XRECFIX EQU X'01' Fixed
XRECVAR EQU X'02' Variable
XRECUND EQU X'03' Undefined
*
XRFLAG1 DS X Run time information flags 1
XOPOPT EQU X'80' OPEN, missing optional file
XOPREV EQU X'40' OPEN REVERSED (valid when XOPENED)
XOPNOREW EQU X'20' OPEN, NO REWIND (valid when XOPENED)
XCLNOREW EQU X'10' CLOSE, NO REWIND (valid when XCLOSED)
XCLLOCK EQU X'08' CLOSE, LOCK (valid when XCLOSED)
XCLREMOV EQU X'04' CLOSE FOR REMOVAL (valid when XCLOSED)
XSOKACT EQU X'02' A successful action since OPEN
*
XRFLAG2 DS X Run time information flags 2
XPEND EQU X'20' OPEN or CLOSE pending
XSEOF EQU X'10' Previous READ hit end of file
XEOP EQU X'08' End of page
XMOPTNL EQU X'04' OPTIONAL FILE MISSING
XADVAFT EQU X'02' WRITE AFTER ADVANCING x LINES
XADVBEF EQU X'01' WRITE BEFORE ADVANCING x LINES
FILLER4 DS H Reserved
*
XFMODE DS X Current file mode
XOPENED EQU X'01' Opened
XCLOSED EQU X'02' Closed
XNEVERO EQU X'03' Never opened
*
XOMODE DS X Information about OPEN (valid when XOPENED)
XOPIN EQU X'01' OPEN INPUT
XOPOUT EQU X'02' OPEN OUTPUT
XOPIO EQU X'03' OPEN IO
XOPEXT EQU X'04' OPEN EXTENDED
*
XCMODE DS X Information about CLOSE (valid when XCLOSED)
XCLFILE EQU X'01' CLOSE
XCLUNIT EQU X'02' CLOSE REEL/UNIT
*
XLASTREQ DS X Last operation on file
XLASTRD EQU X'01' READ
XLASTWRT EQU X'02' WRITE
XLASTRWT EQU X'03' REWRITE
XLASTSTR EQU X'04' START
XLASTDLT EQU X'05' DELETE
XLASTOPN EQU X'06' OPEN
XLASTCLO EQU X'07' CLOSE
**
* Various LINAGE values
*
XLNLING DS F Linage
XLNFOOT DS F Linage footing
XLNTOP DS F Linage top
XLNBOT DS F Linage bottom
XLNCTR DS F Linage counter
**
* File Status
*
XFSTAT DS X File status, in 2 hex bytes
XVSMCOD DS X VSAM feedback code
XVSMRET DS X VSAM return code
XVSMFUNC DS X VSAM function code
*
* XADVVAL DS F Write after/before advancing value
*
XRECLEN DS F Record length; max length for variable rec
XBLKLEN DS F Block size
XRECLAD DS A Address of address of record
XBUFAD DS A Address of buffer provided by DFSMS
*
XPNAME DS A Address of program name
XPNAMLEN DS H Program name length
FILLER5 DS H Reserved
*
FILLER6 DS AD
XPROGEP DS AD Input: Enter point address of COBOL program
XPSTACK DS AD Input: Address of XPLINK stack
XCAA DS AD Input: Address of LE CAA
XWKAREA DD AD Input: Address of 2048 bytes work area
FILLER7 DS 4F Reserved
*
* 1 2 3 4 5 6 7
* 345678901234567890123456789012345678901234567890123456789012345678901
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO2 DSECT
XFNCODE2 DS F Input: Function code, =2 for RT information
FILLER20 DS A reserved
XSIG2 DS F X'C0B00501'
XVER2 DS H Version of this information structure block
XLEN2 DS H Input: Length of this data structure, 96
XDSA2 DS A Input: DSA of COBOL program to be querired (optional)
*
FILLER21 DS X Reserved
FILLER22 DS X Reserved
FILLER23 DS X Reserved
*
XRFLAG4 DS X Run Time Flags
XINSORT EQU X'02' Sort is active
XISMAIN EQU X'01' Program is main
*
XSDREC DS A Address of active sort record
XSDLEN DS F Sort record len
*
FILLER24 DS 6F Reserved
*
XEP2 DS AD Input: Entry point of COBOL program
XPSTACK2 DS AD Input: Address of XPLINK Stack
XCAA2 DS AD Input: Address LE CAA
XWKAREA2 DS AD Input: Address of 2048 work area
*
FILLER25 DS 2F Reserved
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO3 DSECT
XFNCODE3 DS F Input: Function code, =3 for WSA address query
FILLER30 DS 3A reserved
XSIG3 DS F X'C0B00501'
XVER3 DS H Version of this information structure block
XLEN3 DS H Input: Length of this data structure, 72
*
XEP3 DS AD Input: Entry point address of COBOL program
XWSA DS AD Address of WSA
*
XPSTACK3 DS AD Input: Address of XPLINK stack
XCAA3 DS AD Input: Address of LE CAA
XWKAREA3 DS AD Input: Address of 2048 bytes work area
FILLER31 DS 2F Reserved
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO4 DSECT
XFNCODE4 DS F Input: Function code, =4 for file status update
FILLER40 DS 3A reserved
XSIG4 DS F X'C0B00501'
XVER4 DS H Version of this information structure block
XLEN4 DS H Input: Length of this data structure, 144
*
XDSA4 DS AD Input: DSA address of COBOL program (optional)
XFILENM DS CL30 File Name. COBOL FD name of the file.
FILLER41 DS CL2
XFSTATUS DS AD Addr of buff containing new File Status data
XFSLEN DS F Length of XFSTATUS buffer
*
FILLER42 DS 5F Reserved
XEP4 DS AD COBOL program entry point address
XSTACK4 DS AD current XPLINK stack address
XCAA4 DS AD Input: LE CAA address
XWKAREA4 DS AD Input: Address of 2048 bytes work area
FILLER43 DS 4F Reserved
*
* 1 2 3 4 5 6 7
* 345678901234567890123456789012345678901234567890123456789012345678901
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO8 DSECT
XFNCODE8 DS F Input: Function code, =8 for static area query
FILLER80 DS 3A Reserved
XSIG8 DS F Eye-catcher (output)
XVER8 DS H Version of this information structure block (output)
XLEN8 DS H Input: Length of this data structure, 200
*
XEP8 DS AD Input: Entry point addr of COBOL program
XDSA8 DS AD Input: DSA of COBOL program (optional)
XCBACK8 DS AD Input: Address of the callback function (optional)
*
XSA8 DS AD Address of Above the Bar Heap (output)
XSALEN8 DS FD Length of Above the Bar Heap (output)
XS31A8 DS AD Address of Above the (output)
XS31LEN8 DS FD Length of Below the Bar Heap (output)
XS24A8 DS AD Address of Below the Line Heap (output)
XS24LEN8 DS FD Length of Below the Line Heap (output)
*
XWSTOR8 DS AD Address of WORKING-STORAGE section (output)
XWSLEN8 DS FD Length of WORKING-STORAGE section (output)
FILLER81 DS 8F Reserved
XWSA8 DS AD Address of CWSA (output)
XIBYTE8 DS AD Address of Information Byte (output)
*
FILLER82 DS 3H Reserved
XPNALEN8 DS H Length of program name (output)
XPNAME8 DS AD Address of program name (output)
*
XCAA8 DS AD Input: Address of the LE CAA
XWKAREA8 DS AD Input: Address of 2048 bytes work area
FILLER83 DS 2F Reserved
*
*
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO11 DSECT
(Refer to the "Layout of the information structure for AMODE 31”)
*
*
--------------------------------------------------------------------------------
*
* 1 2 3 4 5 6 7
*
* 345678901234567890123456789012345678901234567890123456789012345678901
*
XINFO12 DSECT
Layout of the DSECT is the same for the corresponding one in AMODE31
(Refer to the “Layout of the information structure for AMODE 31”)
*
*
~~~~~~ E N D ~~~~~


Usage notes
- R13 must point to the caller's DSA.
- R14 is the return address.
- R15 is the entry point address of IGZXAPI.
- On return from the routine, R15 is set to zero if the call is successful. R15 is set to nonzero if the call is not successful and the requested information is not available.