A field definition describes a field within a record and its format. It is used alone or with other field definitions to form a format definition. You can use fields and formats in various print commands to cause DUMPALL to process only the specified fields from each record and to specify how each field is to be printed.
<field definition>
── [ ─┬────────────────────────────┬─<field offset>─┬────────────────┬─► └─ ' ──<mnemonic>── ' ── := ─┘ └─<field length>─┘ ►─┬──────────────┬─ ] ─────────────────────────────────────────────────┤ └─<field type>─┘
<field offset>
──┬─ WORD ──<number>─┬────────────────────────┬────────────────────────┤ │ ├─ CHARACTER ─┬─<number>─┤ │ ├─ BYTE ──────┤ │ │ └─ DIGIT ─────┘ │ ├─ CHARACTER ─┬─<number>────────────────────┘ ├─ BYTE ──────┤ └─ DIGIT ─────┘
<field length>
──┬─ FOR ──<number>─┬───────────────────┬──────────────────────────────┤ │ ├─ WORDS ───────────┤ │ ├─ BYTES ───────────┤ │ ├─ DIGITS ──────────┤ │ └─ CHARACTERS ──────┤ └─ BITS ──<number>─┬─ FOR ─┬─<number>─┘ └─ : ───┘
<field type>
──┬──────┬─┬─ DECIMAL ─────┬───────────────────────────────────────────┤ └─ IN ─┘ ├─ REAL ────────┤ ├─ HEXADECIMAL ─┤ ├─ OCTAL ───────┤ ├─ EBCDIC ──────┤ └─ ASCII ───────┘
Explanation
'<mnemonic>':=
Names the field. The mnemonic is entered into the defines file and can be used in subsequent format definitions to represent the field mnemonic. The mnemonic can be any valid identifier from 1 to 63 characters in length. If the field definition is part of a define command, this option must be present. Refer to the DEFINE command description in this section.
Note: | Mnemonic identifiers used in any of the field definitions are case-sensitive, i.e. ABC is distinct from abc. |
Specifies the offset of the field within the record. This offset can be specified in words, 8-bit characters or bytes, 4-bit digits, words and characters, words and bytes, or words and digits. WORD specifies 48-bit or 6-byte units. If you specify words and characters or words and bytes, the number of characters of bytes must be 5 or less. If you specify words and digits, the number of digits must be 11 or less. CHARACTER and BYTE specify 8-bit units. DIGIT specifies 4-bit units. The offset value is zero relative. The first word, character, byte, or digit of a record is at offset 0, the second is at offset 1, and so forth.
<field length>
Specifies the length of the field. If you do not specify the units for the field length, such as words or bytes, DUMPALL uses the units that you specified for the field offset. If you do not specify a field length, DUMPALL assumes the length of the field is 1.
Specifies the type of formatting to be used. If you do not specify a field type, DUMPALL determines the type from the field length and units according to Default Field Type.
Table 3. Default Field Type
Units |
Length |
Type |
---|---|---|
WORDS |
2 or less words |
Real |
WORDS |
more than 2 words |
Hex |
BYTES |
|
EBCDIC |
CHARACTERS |
|
EBCDIC |
DIGITS |
|
Hex |
BITS |
|
Real |
WORD <number>
Specifies the number of the word in the field where the field definition begins. Word numbers are relative to 0. The first word of a record is word 0, the second word is word 1, and so forth.
CHARACTER <number>
BYTE <number>
DIGIT <number>
Following the WORD <number> option, these options specify the character, byte, or digit in the word where the field definition begins and is zero-relative. The first character, byte, or digit of a word is number 0, the second is number 1, and so forth. If no WORD <number> option appears, these options specify a particular character, byte, or digit where the field definition begins and is zero-relative. The first character, byte, or digit of a record is number 0, the second is number 1, and so forth. CHARACTER and BYTE define 8-bit (EBCDIC) offsets or lengths, and DIGIT defines 4-bit (HEXADECIMAL) offsets or lengths.
FOR <number> WORDS
FOR <number> BYTES
FOR <number> DIGITS
FOR <number> CHARACTERS
Specify the field length in words, bytes, digits, or characters. If no unit (WORDS, BYTES, DIGITS, or CHARACTERS) is specified, the length is in the units used to specify the field offset.
If you specified the field offset in digits or in words and digits, you cannot specify the field length in bytes or characters.
BITS <number> FOR <number>
Specifies a partial word field with a length of one word. The first number specifies the left bit of the field and must be between 0 and 47, inclusive. The second number specifies the number of bits in the field and must range from 1 through 48, inclusive.
If you specify less than 48 bits, DUMPALL fills the missing leading bits with binary zeros to obtain a full 48-bit entity. If you specify the field type as HEXADECIMAL, DUMPALL prints the field bit as 12 hexadecimal characters. If you specify the field type as EBCDIC or ASCII, DUMPALL prints the field bit as 6 characters. In the latter case, the leading binary zeros print as question marks (?).
DECIMAL
Specifies an integer field (COMP). If the field identified does not evaluate to an integer value, it is displayed as though REAL had been specified.
REAL
Specifies a floating-point field (COMP-2).
HEXADECIMAL
Specifies a 4-bit alphanumeric field (COMP-2).
OCTAL
Specifies a 3-bit field.
EBCDIC
Specifies an 8-bit alphanumeric field (DISPLAY). If you specified the field offset in digits or in words and digits, you cannot specify a field type of EBCDIC.
ASCII
Specifies a 7-bit alphanumeric field (ASCII). If you specified the field offset in digits or in words and digits, you cannot specify a field type of ASCII.
Example 1
Example 1 describes a field that contains word 3 of the record in real format. Because the field length is not specified, it defaults to 1 word—word in this example because the field offset is specified in words. The field type is not specified so, according to Default Field Type, a one-word field defaults to type real.
[WORD 3]
Example 2
Example 2 describes a field that contains the first five bytes of the record in EBCDIC format. Because the units for field length are not specified, they default to the units specified for the field offset, which in this example is bytes. The field type is not specified so, according to Table 8-2, a field of bytes defaults to the type EBCDIC.
[BYTE 0 FOR 5]
Example 3
Example 3 describes a field that contains bits 47 through 24 of word 4 in hexadecimal format. The field is entered in the defines file under the mnemonic FLD1.
['FLD1':=WORD 4 BITS 47:24 IN HEX]
Example 4
Example 4 describes a field that contains digits 72 through 75 of the record in hexadecimal format. The field offset of digit 72 is equivalent to the offset of word 6 because there are 12 digits per word. The field type is not specified, so with the units for the field length (digits), we determine from Default Field Type that the type is hexadecimal.
[WORD 6 FOR 4 DIGITS]
Example 5
Example 5 describes a field that contains bytes 20 through 29 of the record in EBCDIC. The units for the field length are not specified, so they default to the units for the field offset, which in this example is bytes. The field type is not specified, so according to Default Field Type, a field of bytes defaults to the type EBCDIC.
[BYTE 20 FOR 10]