You are on page 1of 3

|********************************* TOP OF DATA ********************************|

|
*** LEVEL-NUMBERS ***
|
|
|
| Each data description entry within the DATA DIVISION must begin with a
|
| level-number. The level-number specifies the logical hierarchy of data
|
| within a record. It also identifies certain special purpose data
|
| entries.
|
|
|
| The level-number portion of a data description entry is formatted as
|
| shown below:
|
|
|
|
level-number data-name/FILLER
|
|
|
| Level-number may be any number from 01 to 49. It may also be coded as
|
| 77. Single-digit numbers (1-9) may be substituted for level-numbers
|
| 01-09.
|
|
|
| Successive data description entries may be indented according to level|
| number in order to high-light "logical" data relationships.
|
|
|
| Data-name identifies the data item being described.
|
|
|
| FILLER specifies that the data item is not explicitly referrenced in
|
| the program.
|
|******************************* BOTTOM OF DATA *******************************|
|********************************* TOP OF DATA ********************************|
|
*** LEVEL 66 ENTRIES ***
|
|
|
| Level-66 entries are special data description entries which regroup
|
| previously defined items. A level-66 entry is formatted as shown
|
| below:
|
|
|
|
66 data-name RENAMES clause
|
|
|
| A level-66 entry cannot rename a another level-66 item nor can it
|
| rename a level-01, level-77, or level-88 item. All level-66 items
|
| associated with items in a record must immediately follow that record.
|
|
|
| For more details, see the RENAMES clause.
|
|******************************* BOTTOM OF DATA *******************************|
|********************************* TOP OF DATA ********************************|
|
*** RENAMES CLAUSE ***
|
|
|
| The RENAMES clause is an optional clause which can be specified as part
|
| of a data description entry. It allows for alternative, possibly
|
| overlapping, groupings of elementary data items.
|
|
|
| The RENAMES clause is formatted as shown below:
|
|
|
|
66 data-name1 RENAMES data-name2 THRU/THROUGH data-name3
|
|
|
| As shown, data description entries containing the RENAMES clause must
|
| be associated with level-number 66.
|
|
|
| Data-name1 is the name of the item which is to RENAME another item.
|
| Data-name2 identifies the data item or, if data-name3 is specified, the
|
| start of the data items which are being RENAMED. Data-name2 cannot be
|
| a level-01, level-77, level-88, or another level-66 entry.
|
|
|

| When data-name3 is specified, data-name1 is treated as a group item


|
| which includes all elementary items starting with data-name2 (or the
|
| first elementary item within data-name2 if it is a group item) and
|
| ending with data-name3 (or the last elementary item within data-name3
|
| if it is a group item). Data-name3 cannot be subordinate to data|
| name2.
|
|
|
| One or more entries containing the RENAMES clause can be written for a
|
| given logical record; however, all RENAMES entries associated with one
|
| logical record must immediately follow that record's last data
|
| description entry.
|
| As an example:
|
|
|
|
01 RECORD1.
|
|
05 FIELD1...
|
|
05 FIELD2...
|
|
05 FIELD3...
|
|
05 FIELD4...
|
|
05 FIELD5 RENAMES FIELD2 THRU FIELD4.
|
|
10 FIELD6...
|
|
10 FIELD7...
|
|
|
| FIELD5 RENAMES and provides an alternative grouping for the "logical
|
| record" represented by FIELD2, FIELD3, and FIELD4.
|
|******************************* BOTTOM OF DATA *******************************|
|********************************* TOP OF DATA ********************************|
|
*** LEVEL 88 ENTRIES ***
|
|
|
| Level-88 entries are special data description entries which associate a
|
| condition-name with a set of values. A level-88 item is formatted as
|
| shown below:
|
|
|
|
88 condition-name VALUE clause
|
|
|
| For more details, see the VALUE clause.
|
|******************************* BOTTOM OF DATA *******************************|
|********************************* TOP OF DATA ********************************|
|
*** VALUE CLAUSE ***
|
|
|
| The VALUE clause is an optional clause which can be specifed as part of
|
| a data description entry. It specifies the initial content of a data
|
| item. It can also be used to specify the value(s) associated with a
|
| condition-name.
|
|
|
| The VALUE clause is formatted as shown below:
|
|
|
|
Format 1
|
|
-------|
|
VALUE {IS} literal
|
|
|
|
Format 2
|
|
-------|
|
88 condition-name VALUE/VALUES {IS/ARE}
|
|
literal1 {THROUGH/THRU} literal2
|
|
|
| Format 1 is used when specifying an initial value for a data item.
|
| This is the value which will be stored in the data item when the
|
| program begins executing. If no Format 1 VALUE clause is specified for
|
| an item, the content of the item at the start of program execution is
|

| unpredictable.
|
|
|
| Format 2 is used when specifying value(s) associated with a condition|
| name. A single value, a set of values, a range of values, and/or
|
| combinations of sets and ranges of values can be specified by coding
|
| the appropriate number of iterations of literal1 and/or the appropriate
|
| number of iterations of literal1 THRU literal2. When the THRU phrase
|
| is specified, literal 1 must be less in value than literal2.
|
|
|
| The level-88 condition-name entries associated with a particular item
|
| must immediately follow the data description entry for that item. Each
|
| such level-88 entry implicitly has the PICTURE characteristics of the
|
| associated item.
|
|
|
| Only Format 2 VALUE clauses may be coded in the FILE and LINKAGE
|
| SECTIONS. As an IBM extension, Format 1 VALUE clauses coded in the
|
| FILE and LINKAGE SECTIONS are treated as comments.
|
|
|
| The initial value specified by a Format 1 VALUE clause is independent
|
| of any BLANK WHEN ZERO or JUSTIFIED clause which may be included as
|
| part of the data description entry. It is also independent of any
|
| editing characters in the PICTURE clause.
|
|
|
| The Format 1 VALUE clause must not be specified for a data description
|
| entry that contains or is subordinate to an item with a REDEFINES
|
| clause.
|
|
|
| When specified at the group level, the literal contained in a Format 1
|
| VALUE clause must be a non-numeric literal or a figurative constant.
|
| The group area is initialized without regard for the subordinate items
|
| within the group. In this case, the subordinate items may not include a
|
| Format 1 VALUE clause.
|
|
|
| Literals contained in a VALUE clause:
|
|
|
|
For a numeric item:
|
|
|
|
Must be numeric. Must have a value that is within the range
|
|
of values indicated by the PICTURE clause. If the literal is
|
|
signed, the associated PICTURE string must contain a sign
|
|
symbol (S). For a Format 1 VALUE clause, placement of the
|
|
literal within storage is based on the normal alignment rules
|
|
for numeric moves.
|
|
|
|
For a non-numeric item:
|
|
|
|
Must be non-numeric. For a Format 1 VALUE clause, the number
|
|
of characters in the literal must not exceed the size of the
|
|
item. Placement of the literal within storage is based on
|
|
the normal alignment rules for non-numeric moves.
|
|
|
|
For examples of the VALUE clause, see DATA DESCRIPTION ENTRIES.
|
|******************************* BOTTOM OF DATA *******************************|

You might also like