Previous Topic: EXECUTE PATHNext Topic: FIND / GET Logical Record


FIELDS FOR

FIELDS FOR modifies the internal field list for a record. Use this command to reduce the size of report files. The field list you specify applies to all subsequent retrievals of the named record type. FIELDS FOR can be associated with either database record retrieval or logical record retrieval.

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

Syntax:

►►─── FIElds FOR ─┬────────────┬─┬─ record-name ─────────┬────────────────────►
                  └─ view-id. ─┘ └─ logical-record-name ─┘

 ►─┬─ ARE ──────┬─ (field-list) ──────────────────────────────────────────────►
   ├─ ARE ALSO ─┤
   └─ ARE NOT ──┘

   ┌───────────────────────┐
 ►─▼─┬─┬─ DISplay ─────┬─┬─┴──────────────────────────────────────────────────►◄
     │ └─ HEXadecimal ─┘ │
     ├─┬─ COMmas ───┬────┤
     │ └─ NOCommas ─┘    │
     ├─┬─ $ ───┬─────────┤
     │ └─ NO$ ─┘         │
     ├─┬─ LEAdzeros ───┬─┤
     │ └─ NOLeadzeros ─┘ │
     └─┬─ SPArse ─┬──────┘
       └─ FULl ───┘

Parameters:

view-id

The qualifying ID for the record or logical record name. Use view-id when you are signed on to multiple subschemas. View-id refers to the subschema where the record or logical record can be found.

ARE/ARE ALSO/ARE NOT
DISPLAY/HEXADECIMAL

Specifies whether named fields are output in display or hexadecimal format.

COMMAS/NOCOMMAS

Specifies whether the named fields are displayed with or without commas. Nonnumeric fields are unaffected.

$ NO$

Specifies whether named fields are displayed with or without dollar signs. Nonnumeric fields are unaffected.

LEADZEROS/NOLEADZEROS

Specifies whether the numeric fields in the field list are displayed with or without leading zeros; nonnumeric fields are unaffected.

SPARSE/FULL

Specifies whether repeating column values are displayed or not.

Examples:

The fields of the JOB record are listed below:

JOB PAGE 1.1 LINE 1 (LEVEL) (FIELD NAME) (#OCCURS) (USAGE) (PICTURE) 02 JOB-ID-0440 DISPLAY 9(4) 02 TITLE-0440 DISPLAY X(20) 02 DESCRIPTION-0440 GROUP 03 DESCRIPTION-LINE-0440 2 DISPLAY X(60) 02 REQUIREMENTS-0440 GROUP 03 REQUIREMENT-LINE-0440 2 DISPLAY X(60) 02 MINIMUM-SALARY-0440 DISPLAY S9(6)V99 02 MAXIMUM-SALARY-0440 DISPLAY S9(6)V99 02 SALARY-GRADES-0440 4 DISPLAY 9(2) 02 NUMBER-OF-POSITIONS-0440 DISPLAY 9(3) 02 NUMBER-OPEN-0440 DISPLAY 9(3) 02 FILLER DISPLAY XX

Fields Are

When you issue a retrieval command for the JOB record without a field-list, you receive all the fields above providing OPTION ALL is in effect. You can, however, modify the field-list before or after retrieval with a FIELDS FOR command:

fields for job are (job-id-0440, title-0440)

The internal field list becomes:

JOB-ID-0440
TITLE-0040

Fields Are Also

If you want to add fields to the field list:

fields for job are also (minimum-salary-0440)

The internal field list becomes:

JOB-ID-0440
TITLE-0440
MINIMUM-SALARY-0440

Fields Are Not

You can omit fields from the field list:

fields for job are not (title-0040)

The internal field list becomes:

JOB-ID-0440
MINIMUM-SALARY-0440

For more information:

Global Syntax