Specifying the AIB mask

The application interface block (AIB) is used by your program to communicate with IMS, when your application does not have a PCB address or the call function does not use a PCB.

The application program can use the returned PCB address, when available, to inspect the status code in the PCB and to obtain any other information needed by the application program. The AIB mask enables your program to interpret the control block defined. The AIB structure must be defined in working storage, on a fullword boundary, and initialized according to the order and byte length of the fields as shown in the following table. The table’s notes describe the contents of each field.

Table 1. AIB fields
Descriptor Byte Length DB/DC DBCTL DCCTL DB Batch TM Batch
AIB identifier 1 8 X X X X X
DFSAIB allocated length 2 4 X X X X X
Subfunction code 3 8 X X X X X
Resource name 1 4 8 X X X X X
Resource name 2 5 8 X X X X X
Reserved 6 8          
Maximum output area length 7 4 X X X X X
Output area length used 8 4 X X X X X
Resource field 9 4 X X X X X
Optional area length 10 4 X X X X X
Reserved 11 4 X X X X X
Return code 12 4 X X X X X
Reason code 13 4 X X X X X
Error code extension 14 4 X X X    
Resource address 1 15 4 X X X X X
Resource address 2 16 4 X X X X X
Resource address 3 17 4 X X X X X
User defined token 18 16 X X X X X
Return token 19 8 X X   X  
Reserved 20 16          
AIB Identifier (AIBID)
This 8-byte field contains the AIB identifier. You must initialize AIBID in your application program to the value DFSAIBbb before you issue DL/I calls. This field is required. When the call is completed, the information returned in this field is unchanged.
DFSAIB Allocated Length (AIBLEN)
This field contains the actual 4-byte length of the AIB as defined by your program. You must initialize AIBLEN in your application program before you issue DL/I calls. The minimum length required is 128 bytes. When the call is completed, the information returned in this field is unchanged. This field is required.
Subfunction Code (AIBSFUNC)
This 8-byte field contains the subfunction code for those calls that use a subfunction. You must initialize AIBSFUNC in your application program before you issue DL/I calls. When the call is completed, the information returned in this field is unchanged.
Resource Name (AIBRSNM1)

This 8-byte field contains the name of a resource. The resource varies depending on the call. You must initialize AIBRSNM1 in your application program before you issue DL/I calls. When the call is complete, the information returned in this field is unchanged. This field is required.

For PCB related calls where the AIB is used to pass the PCB name instead of passing the PCB address in the call list, this field contains the PCB name. The PCB name for the I/O PCB is IOPCBbb. The PCB name for other types of PCBs is defined in the PCBNAME= parameter in PSBGEN.

Resource Name 2 (AIBRSNM2)
This 8-byte field contains the name of a resource. The resource varies depending on the call. You must initialize AIBRSNM2 in your application program before you issue DL/I calls.
Reserved
This 8-byte field is reserved.
Maximum Output Area Length (AIBOALEN)
This 4-byte field contains the length of the output area in bytes that was specified in the call list. You must initialize AIBOALEN in your application program for all calls that return data to the output area. When the call is completed, the information returned in this area is unchanged.
Used Output Area Length (AIBOAUSE)
This 4-byte field contains the length of the data returned by IMS for all calls that return data to the output area. When the call is completed this field contains the length of the I/O area used for this call.
Resource Field (AIBRSFLD)
This 4-byte field contains a resource. The resource varies depending on the call. You must initialize AIBRSFLD in your application program before you issue DL/I calls.
Optional Area Length (AIBOPLEN)
This 4-byte field contains a resource. The resource varies depending on the call. You must initialize AIBOPLEN in your application program before you issue DL/I calls.
Reserved
This 4-byte field is reserved.
Return code (AIBRETRN)
When the call is completed, this 4-byte field contains the return code.
Reason Code (AIBREASN)
When the call is completed, this 4-byte field contains the reason code.
Error Code Extension (AIBERRXT)
This 4-byte field contains additional error information depending on the return code in AIBRETRN and the reason code in AIBREASN.
Resource Address 1 (AIBRSA1)
When the call is completed, this 4-byte field contains call-specific information. For PCB related calls where the AIB is used to pass the PCB name instead of passing the PCB address in the call list, this field returns the PCB address.
Resource Address 2 (AIBRSA2)
When the call is completed, this 4-byte field contains call-specific information.
Resource Address 3 (AIBRSA3)
When the call is completed, this 4-byte field contains call-specific information.
User Defined Token (AIBUTKN)
This 16-byte field contains a user defined token. The token varies depending on the call.
AIB return token (AIBRTKN)
AIB return token. This 8-byte field contains a token returned by a DL/I call. The usage is specific to the DL/I call for which the token was returned.
Reserved

This 16-byte field is reserved.