Previous Topic: ExpressionNext Topic: DISPLAY and SORT Field-Reference Clause


FIND / GET and COMPUTE Field-Reference Clause

Field-reference is used in the expression clause, which is used in the FIND/GET WHERE criteria clause and the COMPUTE GROUP BY HAVING criteria clause.

Access mode: The syntax below is invalid when the access switch is set to IDMS.

Syntax:

►►─┬─ compute-title ────────────────────────────────────────────────┬─────────►◄
   ├─┬────────────┬─ record-name ─┬────────────────┬─ . ────────────┤
   │ └─ view-id. ─┘               └─ (occurrence) ─┘                │
   └─┬───────────────┬─┬─ olq-header ─────────────────────────────┬─┘
     └─ group-name. ─┘ └─ field-name ─┬─────────────────────────┬─┘
                                      │     ┌───── , ─────┐     │
                                      └─ ( -▼- subscript ─┴─ ) ─┘

Syntax rules:

compute-title

Specifies the name of a previously computed field used as an operand in the expression. This specification is valid only for the COMPUTE command.

view-id

Qualifies the record name by specifying the alternate name of the subschema or table from which the record is retrieved.

record-name (occurrence)

Specifies the record in which the selected field participates. If more than one occurrence of the record appears in the report file or in a retrieval path, the occurrence number of the record can be specified.

If you use occurrence, separate it from the field name with a period. When this parameter is not used, it defaults to the first record type retrieved in the path definition.

group-name

Fields in the record can be specified as follows:

Examples:

Matches mask-value

When specifying a match, if a character other than one of the mask-value characters is specified, the match is for that character only.

matches 'string'

This MATCHES clause specifies that the characters of the string to be found must be STRING.

Matching any characters

Only the left-most significant characters of the mask need be specified explicitly when the remaining characters in the field are allowed to have any value.

To retrieve all addresses where the first two digits of the zip code are 02, the mask value can be specified as follows:

'02'

Unspecified mask characters are treated as if * (any character) were specified.

Numeric values

If the zip code is to be tested for numeric values only, the mask must be specified as:

'02###'

If the specified mask value is longer than the field being checked, the extra mask characters will be ignored.

For more information:

Coding Considerations