Start of change

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:

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

You must specify the offset 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 for the offset is 1 and the offset 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 offsets and lengths:

Field    Offset Length
Labname  1      5
Street   10     20
State    30     2

The application program has a COBOL copy book with the following map:

Field    Offset 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 offset and length values in a DFSDDLT0 test application using hexadecimal edit mode:

               00000000
GU IBMLABS*O ('00010005'x=SVL  )
               00000000
GU IBMLABS*O ('00010005'x=ARC  )
               00030000
GU IBMLABS*O ('00000002'x=CA)
               00000000
GU IBMLABS*O ('000060003'x=DEV)

In the first GU call, the offset is 1 and the length of the target data is 5.

End of change