Status codes that can be issued after an ISRT call

The nonblank status codes that can be returned to an application program after an ISRT call are as follows.

  • AM—An insert was attempted and the value of PROCOPT is not I
  • GE—The parent of the destination parent or logical child was not found
  • II—An attempt was made to insert a duplicate segment
  • IX—The rule specified was P, but the destination parent was not found

    One reason for getting an IX status code is that the I/O area key check failed. Concatenated segments must contain the destination parent's key twice—once as part of the logical child's LPCK and once as a field in the parent. These keys must be equal.

The following two figures show a physical insert rule example.

Figure 1. Physical insert rule example
Root: CUSTOMER (RULES=(P--)). Child is BORROW (RULES=(P--)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(P--)). LOANS has VLC named CUST.
Figure 2. Paths for physical insert rule example
Two paths: Physical path to CUSTOMER and BORROW and logical path to LOANS. Physical path to LOANS and logical path to CUSTOMER and BORROW.
Figure 3. ISRT and status codes for physical insert rule example
    ISRT 'CUSTOMER'  STATUS CODE='  '
ISRT 'BORROW'  STATUS CODE='  ' ('IX' if LOANS does not exist)

The following two figures show a logical insert rule example.

Figure 4. Logical insert rule example
Root: CUSTOMER (RULES=(L--)). Child is BORROW (RULES=(L--)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(L--)). LOANS has VLC named CUST.
Figure 5. ISRT and status codes for logical insert rule example
ISRT 'LOANS'  STATUS CODE='  '
ISRT 'CUST'  STATUS CODE='IX'

The IX status code shown in the preceding figure is the result of omitting the concatenated segment CUST/CUSTOMER in the second call. IMS checked for the key of the CUSTOMER segment (in the I/O area) and failed to find it. With the L insert rule, the concatenated segment must be inserted to create a logical path.

The following two figures show a virtual insert rule example.

Figure 6. Virtual insert rule example
Root: CUSTOMER (RULES=(V--)). Child is BORROW (RULES=(V--)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(V--)). LOANS has VLC named CUST.
Figure 7. ISRT and status codes for virtual insert rule example
ISRT 'CUSTOMER'  STATUS CODE='  '
ISRT 'BORROW/LOANS'  STATUS CODE='  '

The code above replaces the LOANS segment if present, and insert the LOANS segment if not. The V insert rule is a powerful option.