Previous Topic: Call FormatNext Topic: Program Communication


Segment Search Arguments

A segment search argument (SSA) specifies criteria for selecting a segment occurrence along the hierarchical access path. SSAs take the following form:

Syntax

segment-name(field-name  operator  field-value)

Parameters

segment-name

Identifies the name of the desired segment.

field-name

Identifies the name of a field in the segment.

operator

Specifies a standard relational operator (=, >=, <= , etc.).

field-value

Specifies an actual value for field-name.

Call-level DL/I Example

The example below selects the EMPLOYEE segment occurrence whose ID field has the value 123456:

GU, EMP-PCB, IO-A, EMPLOYEE (ID = 123456)

DL/I searches the EMPLOYEE segment occurrences within the database identified by EMP-PCB (the PCB name) and returns the contents of the found occurrence to IO-A (the user I/O area). If duplicate values are allowed for the search field, DL/I returns the first qualifying occurrence into the I/O area.

You can construct more complex selection criteria by combining SSAs with logical operators (AND, OR, etc.). By combining SSAs, you can direct the search to any level in the hierarchy.

Command-level DL/I (EXEC DLI) Example

DL/I database access is also possible using EXEC DLI commands. These commands allow similar functionality and content as call-level DL/I. The example below selects the EMPLOYEE segment occurrence whose ID field has the value 123456 (assuming EMP-ID contains ‘123456’), and is equivalent to the call-level example above:

EXEC DLI GU USING PCB(EMP-PCB) SEGMENT(EMPLOYEE) WHERE(ID=EMPID) INTO(IO-A);

You can construct more complex selection criteria by combining multiple SEGMENT statements. By combining SEGMENT statements, you can direct the search to any level in the hierarchy.