DEFINE Command

The DEFINE command declares and specifies fields and formats for use in subsequent print commands such as LIST and DMPMT. Refer to “Format Definition” and “Field Definition” later in this section.

Syntax

           ┌◄────────────┬──────┬────────────┐
           │             └◄─ , ─┘            │
── DEFINE ─┴─┬─ FIELD ──<field definition>─┬─┴──────────────────────────┤
             └─<format definition>─────────┘

Explanation

You must assign a mnemonic name to each format that you define in this command. You must also assign a mnemonic name to any field that you define that is not part of a format definition.

<field definition>

Describes a field within a record and its format. Refer to “Field Definition” later in this section for an explanation of <field definition>.

<format definition>

Contains one or more field definitions. Refer to “Format Definition” later in this section for an explanation of <format definition>.

Example 1

Example 1 declares and names the field F1 for use in subsequent print commands. F1 describes a field that contains the first four bytes of a record in EBCDIC format. EBCDIC is the default when the field offset is specified in bytes.

DEFINE FIELD ['F1':= BYTE 0 FOR 4]

Example 2

Example 2 declares and names the format FMT1 for use in subsequent print commands. FMT1 consists of the field F2, which is also entered into the defines file, the field F1, which has been previously defined, and the unnamed field describing byte 80 of the record.

 DEFINE FORMAT 'FMT1':= ['F2':= WORD 7 DEC]  'F1' [BYTE 80]