Previous Topic: DEFINE Command Format 2Next Topic: DELETE Command


DEFINE Command Format 3

(Areas 2A, 2B)

Format 3 of the DEFINE command enables you to redefine all or part of an existing field or array element. This command defines:

Sample DEFINE Command Format 3

►►─┬─ DEFINE ─┬─ fieldname1=fieldname2 ─┬─ n1 ─ THRU ─ n2 ─┬─ data-type ──────►
   └─ DEF ────┘                         └─ n1 ─────────────┘

 ►─┬─────────────────────────────────────────────────┬────────────────────────►
   └─┬─ HEADING ─┬─ ' heading 1 ' ─┬───────────────┬─┘
     └─ HDG ─────┘                 └─ 'heading 2' ─┘

 ►─┬────────────────────────┬─┬──────────────────────────┬────────────────────►◄
   └─ PICTURE ─ 'edit ptn' ─┘ └─ OCCURS ─ n ─┬─────────┬─┘
                                             └─ TIMES ─┘
fieldname1

Is a user-supplied name assigned to the location specified in the DEFINE command.

fieldname2

Is the predefined name of a field or element of an array which you must redefine.

n1 THRU n2

Indicates, in bytes, the relative starting and ending positions, respectively, of the field within the predefined fieldname2.

TO or – (dash) can be used in place of THRU.

n1

Indicates that the field is one byte long and that integer n1 is the position of the field.

data-type

Describes the data type of the field. Use the following entries:

X

Indicates that the field contains alphanumeric data and can contain any EBCDIC character.

H

Works the same as data-type X for moves and compare operations but on a PRINT statement displays in HEX. For example, A12 would display as C1F1F2 on the print line. Maximum length is 62.

N(d)

Indicates that the field contains zoned decimal data. d indicates the number of implied decimal places.

P(d)

Indicates that the field contains packed decimal data. d indicates the number of implied decimal places.

B(d)

Indicates that the field contains binary data. d indicates the number of

B(d)

Indicates that the field contains binary data. d indicates the number of implied decimal places.

U9(d)0

Indicates that the field contains unsigned binary data. d indicates the number of implied decimal places.

S

Indicates that the field contains bit string data and must have a length of only one byte.

HEADING

Specifies an optional separator used to denote that the literals that follow are to be interpreted as headings. HDG can be used in place of HEADING.

'heading 1' 'heading 2'

Enables you to assign one or two heading lines to the field. The heading lines appear as column headings if the field is printed in a report.

PICTURE 'edit ptn'

Assigns an edit mask to be used to edit the field when it is printed, overriding the Reporting Facility default editing. PIC can be used in place of PICTURE in the command.

OCCURS n TIMES

Indicates that this is an array definition occurring n times in contiguous locations beginning with the first byte of fieldname1. Using the keyword TIMES is optional, but recommended for documentation purposes.