Previous Topic: FIND / GET and COMPUTE Field-Reference ClauseNext Topic: Field-List Clause


DISPLAY and SORT Field-Reference Clause

This field-reference clause is used in the DISPLAY, and SORT commands and allows you to identify a field in several different ways. With the field-reference clause, you are not restricted to specifying a field name when manipulating or displaying report files. You can identify fields in any of the following ways:

Example:

DEPT.PHONE for the phone field in the Department record, PHONE(2) for the second occurrence of the field that contains the phone number.

Note: The DISPLAY command can also reference the initial portion of a report-file field whose usage is DISPLAY.

The HELP/SHOW REPORT command displays the field names, column numbers, and CA OLQ headers available for use in the field-reference clause.

Syntax:

►►─┬─┬─ column-position ────────────────────────────┬─┬───────────────────┬─┬─►◄
   │ ├─ compute-column-title ───────────────────────┤ └ (character-count) ┘ │
   │ └┬─────────┬─┬ field-name ────────────────────┬┘                       │
   │  └ record. ┘ ├ olq-header ────────────────────┤                        │
   │              │               ┌──── , ────┐    │                        │
   │              └ 'field-name ( ▼ subscript ┴ )' ┘                        │
   │                              ┌───── , ─────┐                           │
   └─┬───────────┬─ field-name ( -▼- subscript ─┴─ ) ───────────────────────┘
     └─ record. ─┘

Expansion of record

►►─┬────────────┬─ record-name ─┬────────────────┬────────────────────────────►◄
   └─ view-id. ─┘               └─ (occurrence) ─┘

Syntax rules:

column-position

Specifies the field in the nth column of the report file. Column numbers appear under the header COL in the HELP REPORT display.

compute-column-title

Specifies the name of a field created by a COMPUTE command. If the computed field name includes blanks or delimiters, it must be enclosed in quotation marks. Computed fields are listed as *COMPUTED* in the HELP REPORT display.

record

For more information:

Coding Considerations