DISPLAY FIELD command

From m204wiki
Revision as of 16:19, 22 March 2017 by ELowell (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Privileges
Any user
Function
Displays the definition of a field in a Model 204 file

Syntax

DISPLAY FIELD [(display-option [,display-option])] {ALL | fieldname [,fieldname]...}

Where:

display-option One of the following:

Option

Displays...

ABBREV

NOABBREV

Name and description of the field in abbreviated form.

NOABBREV is the default.

COMMA

If this is specified, a comma is used to separate the display of the field's attributes, and many of the strings of blanks between the attributes are collapsed to a single blank. Since commas are already used with the NOABBREV option, this actually only has an effect when the ABBREV option is specified. COMMA is available as of version 7.5 of Model 204.

DDL

NODDL

Model 204 data definition language statements needed to rebuild a file.

NODDL is the default.

DEFINITIONS

Name and description of the field; this is the default.

NAMES

Name (only) of the field.

NOUSE

Field output on your terminal, even if a USE command precedes the DISPLAY. Any alternate device remains open, but is not used.

fieldname The name of an existing field in a Model 204 file.

Syntax notes

Only one of the display options DEFINITIONS, NAMES, or ABBREV can be specified. DDL and NOUSE can be specified with any of these options. However, if you specify DISPLAY FIELD (DDL, NAMES), the NAMES option is ignored.

Display options must be enclosed in parentheses and separated by commas or by one or more blanks. Field names must be separated by commas.

For SORT, HASH, and RECORD SECURITY fields, the initialize commands are displayed first.

When displaying PREALLOCATED fields, Model 204 does not check the order in which the fields are displayed.

To extract and store DDL statements, use DISPLAY FIELD (DDL) in conjunction with a USE data set.

You can reverse the default settings NOABBREV and NODDL by specifying CUSTOM=4 in the user's input stream, or via the RESET command.

Example

DISPLAY FIELD SSI SSI (NON-DEFERRABLE, NON-FRV, NON-KEY, NON-CODED, STRING, NON-RANGE, VISIBLE, UPDATE IN PLACE, ORDERED CHARACTER, LRESERVE 15, NRESERVE 15, SPLITPCT 50, IMMED 1, UNIQUE) DISPLAY FIELD (ABBREV) SSI SSI (NDEF NFRV NKEY NCOD STR NNR VIS UP ORD CHAR LRES 15 NRES 50 IMM 1 UNIQ) D FIELD (ABBREV COMMA) SSI SSI (NDEF, NFRV, NKEY, NCOD, STR, NNR, VIS, UP, ORD CHAR, LRES 15, NRES 50, IMM 1, UNIQ) DISPLAY FIELD (ABBREV) ALL ANNIVERSARY DATE ( DEF NFRV KEY NCOD STR NR VIS UP NORD) NAME ( DEF NFRV KEY NCOD STR NNR VIS UP NORD) POSITION ( DEF FRV KEY MV NCOD STR NNR VIS UP NORD) DISPLAY FIELD (ABBREV) NAME - ANNIVERSARY DATE, POSITION NAME ( DEF NFRV KEY NCOD STR NNR VIS UP NORD) ANNIVERSARY DATE ( DEF NFRV KEY NCOD STR NR VIS UP NORD) POSITION ( DEF FRV KEY MV NCOD STR NNR VIS UP NORD) DISPLAY FIELD (DDL) POLICYHOLDER *** DDL FOR FILE CLIENTS *** DDL REQUEST DATE/TIME 91.255 SEP 12 09.34.26 DEFINE FIELD POLICYHOLDER - (NON-FRV,NON-KEY,NON-CODED,STRING,NON-RANGE, - VISIBLE,UPDATE IN PLACE,NON-ORDERED,NON-UNIQUE, - REPEATABLE)

Usage notes

The DISPLAY FIELD command displays the description of a field in the Model 204 file that is open. This includes fields that have been defined but do not actually appear in any records. Fields are listed in the format specified by the display options (definitions, names only, or abbreviations). The NAMES display option is used generally in conjunction with ALL.

Model 204 sorts the output of the DISPLAY FIELD command by field name whenever ALL is specified. Specifying specific field names in the name list of the DISPLAY command generates output in the order in which the field names appear in the name list.

The ABBREV display option uses abbreviations for the field attributes (for example, STR for STRING). If ABBREV is not specified, full attribute names are displayed. Only applicable field attributes are displayed. For example, if a field is listed as either CODED or FRV, then MANY-VALUED or FEW-VALUED is also listed. However, if the field is both NON-CODED and NON-FRV, MANY-VALUED and FEW-VALUED do not apply and neither is listed.

See DEFINE FIELD command for a complete list of field attributes and abbreviations.

Displaying OI chunk fields and OI chunk targets

The CHUNK field attribute, available as of Model 204 version 7.5, enables more efficient searching on Ordered Index (OI) numeric range (ORDERED NUMERIC) fields by specifying "OI chunks" of data.

DISPLAY FIELD on an OI chunk field indicates the OI chunk target for the field:

DISPLAY FIELD chunkFieldName

displays:

chunkFieldName (CHUNK chunkSize FOR chunkTargetFieldName [, attribute]...)

The following examples show the different options of the DISPLAY FIELD command used on an OI chunk field:

IN QA00 DISPLAY FIELD DOBYYYY DOBYYYY (DEFERRABLE, NON-FRV, NON-KEY, NON-CODED, STRING, NON-RANGE, INVISIBLE, ORDERED NUMERIC, LRESERVE 15, NRESERVE 15, SPLITPCT 50, IMMED 1, NON-UNIQUE, REPEATABLE, CHUNK 10000 FOR DOBYYYYMMDD) IN QA00 DISPLAY FIELD (ABBREV) DOBYYYY DOBYYYY (DEF NFRV NKEY NCOD STR NNR INV ORD NUM LRES 15 NRES 15 SPLT 50 IMM 1 NUNIQ REPT CNK 10000 FOR DOBYYYYMMDD) IN QA00 DISPLAY FIELD (DDL) DOBYYYY *** DDL FOR FILE QA00 *** DDL REQUEST DATE/TIME: 13.147 MAY 27 10.21.58 DEFINE FIELD DOBYYYY - (DEFERRABLE, NON-FRV, NON-KEY, NON-CODED, STRING, NON-RANGE, INVISIBLE, ORDERED NUMERIC, LRESERVE 15, NRESERVE 15, SPLITPCT 50, IMMED 1, NON-UNIQUE, REPEATABLE, CHUNK 10000 FOR DOBYYYYMMDD)

If an OI chunk target is displayed and the DISPLAY FIELD options do NOT include NAMES, ABBREV, or DDL, then the corresponding OI chunk fields are listed in ascending order by OI chunk size:

IN QA00 D FIELD DOBYYYYMMDD DOBYYYYMMDD (DEFERRABLE, NON-FRV, NON-KEY, NON-CODED, STRING, NON-RANGE, VISIBLE, UPDATE-IN PLACE, ORDERED NUMERIC, LRESERVE 15, NRESERVE 15, SPLITPCT 50, IMMED 1, NON-UNIQUE, EXACTLY-ONE, STORE-NULL NONE, LENGTH-EQ 8, CHUNKS(DOBYYYYMM,DOBYYYY))