Specifying the AIB mask

The AIB is used by your program to communicate with IMS™, when your application does not have a program communication block (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 14 8 X X X X X
Reserved 1 5 8          
Resource name 2 6 8          
Maximum output area length 7 4 X X X X X

Output area length
used 8

4 X X X X X
AIBRSFLD 9 4          
Reserved 2 10 8          
Return code 11 4 X X X X X
Reason code 12 4 X X X X X
Error code extension 13 4 X   X    
Resource address 14 4 X X X X X
Reserved 3 15 40          
Note:
  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. Reserved 1

    This 16-byte field is reserved.

  6. Resource name 2

    This 8-byte field is reserved.

  7. 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.

  8. 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.

  9. Reserved 2

    This 8-byte field is reserved.

    The first four bytes are used by the ICAL call to specify the time to wait for the synchronous call process to complete (AIBRSFLD).

  10. Return code (AIBRETRN)

    When the call is completed, this 4-byte field contains the return code.

  11. AIBRSFLD

    This 4-byte field contains a resource information. The usage of this field varies depending on the call.

  12. Reason Code (AIBREASN)

    When the call is completed, this 4-byte field contains the reason code.

  13. 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.

  14. Resource Address (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.

  15. Reserved 3

    This 40-byte field is reserved.