O command code

You can use the O command code to specify a SSA qualification with the position and length of the target data instead of a DBD-defined field name.

This command code is valid for full function database types (HDAM, HIDAM, PHIDAM, and PHDAM) and Fast Path DEDBs.

This command code is supported for the following DL/I calls:
  • GU SSA
  • GHU SSA
  • GN SSA
  • GNP SSA
  • GHNP SSA
  • ISRT SSA

When command code O is specified, the SSA qualification can contain either normal field names or the starting position and length of the data that you want to retrieve.

You must specify the position and length as two 4-byte binary values in place of the usual 8-byte character value that is used to specify a field name. The starting position is 1 and the position is relative to the physical start of the segment definition. The maximum length that is supported is the maximum segment size for the database type. The minimum length is 1.

For example, a segment might have several fields defined in the DBD with the following positions and lengths:

Field    Position Length
Labname  1        5
Street   10       20
State    30       2
The application program has a COBOL copy book with the following map:

Field    Position Length
Labname  1        5
Type     6        3
Street   10       20
State    30       2
The database contains two records with the following data:
           
           I          11111111122222222233
           I 12345678901234567901235678901
___________I _____________________________
Segment #1 I SVL  DEV 555 BAILEY AVE    CA
Segment #2 I ARC  RSC 650 HARRY RD      CA
___________I _____________________________
 
You can specify a GU call with the O command code in the following format to retrieve data without needing the fields to be specified in the DBD. The following example demonstrates how to specify the position and length values in a DFSDDLT0 test application using hexadecimal edit mode:
               
              00000000
GU IBMLABS *O(00010005= SVL  )
              00000000
GU IBMLABS *O(00010005= ARC  )
              00010000
GU IBMLABS *O(000E0002= CA)
              00000000
GU IBMLABS *O(00060003= DEV)
In the first and second GU calls, the position is 1 and the length of the target data is 5. In the third GU call, the position is 30 (x'1E') and the length of the target data is 2. In the fourth GU call, the position is 6 and the length of the target data is 3.