Condition Specifications

The following table shows some sample condition specifications.

Condition Specification

Description

IFREC(segname)

Qualified subsequent selection criteria to a specific IMS database record. If no IFREC or IFSEG is specified, dynamic selection criteria applies to the ROOT segment. The selected segment along with its entire IMS database record is returned.

IFSEG(segname)

Qualifies subsequent selection criteria to a specific database segment. If no IFREC or IFSEG is specified, dynamic selection criteria applies to the ROOT segment.

When the segment matches the selection criteria, the segment is selected, along with its children, and all of the segments in its parental path. All children of the segments in the parental path are also selected. No twins of the selected segment or twins of any of the segments in the parental path will be selected, or any of their children. (Twins have the same segment name and exact same parent segment). In addition, the rest of the IMS database record will be selected.

101 = C'NY'

Position 101 for a length of 2 equals 'NY'

1(3) = C'001'

Position 1 for a length of 3 equals '001'

C'TEXAS'

Character string 'TEXAS' anywhere in the record

'TEXAS'

Character string 'TEXAS' anywhere in the record

1(3) = C'001' & 101 = C'NY'

Compound condition

10(4) EQP

Pos 10 for a length of 4 is a valid packed value

80 = C'NY' C'NJ' C'MA'

Position 80 equals one of the three values

80 = C'NY,NJ,MA'

Position 80 equals one of the same three values

100(2) = P'0,1,999'

Two-byte packed field equals one of three values

100 = C"100,00"

Position 100 for a length of 7 equals '100,000'

Note: Quotes are required when the search string contains a comma.

82(2) > 84

Compare position 82 to position 84 for length of 2

101(20) CO C'NEW YORK'

Looks for the character string in columns 101-120

INLIM(5000)

Stop reading/selecting after reading 5000 records.

SELLIM(1000)

Only select 1000 records based on selection criteria

STARTKEY='56789'

Select keyed VSAM records starting with key '56789'