You must use the level number 66 for data description entries that contain the RENAMES clause. A level-66 entry cannot rename another level-66 entry, nor can it rename a level-01, level-77, or level-88 entry.
One or more RENAMES entries can be written for a logical record. All RENAMES entries associated with one logical record must immediately follow that record's last data description entry.
Level number 66 and data-name-1 are not a part of the RENAMES clause itself and are included in the format below only for clarity.
Format 2 (RENAMES Clause -- Level-66 Entry) ->->--66 data-name-1 RENAMES data-name-2--*---------------------------*---><- *--THROUGH--*--data-name-3--* *--THRU-----*
Data-name-1 identifies an alternative grouping of data items.
You cannot use data-name-1 as a qualifier; it can be qualified only by the names of level indicator entries or level-01 entries.
Data-name-2 and data-name-3 identify the original grouping of data items; that is, they must name elementary or group items within the associated level-01 entry, and must not be the same data-name. Both data-names may be qualified.
The OCCURS clause must not be specified in the data entries for data-name-2 and data-name-3, or for any group entry to which they are subordinate. In addition, the OCCURS DEPENDING ON clause must not be specified for any item defined between data-name-2 and data-name-3.
When data-name-3 is specified, data-name-1 is treated as a group item that includes all elementary items:
The keywords THROUGH and THRU are equivalent.
The leftmost character in data-name-3 must not precede the leftmost character in data-name-2; the rightmost character in data-name-3 must not precede the rightmost character in data-name-2. This means that data-name-3 may not be totally subordinate to data-name-2.
When data-name-3 is not specified, all of the data attributes of data-name-2 become the data attributes for data-name-1. That is:
In Format 1, level-number can be any number from 01-49 or 77.
You can substitute single-digit level-numbers 1 through 9 for level-numbers 01 through 09.
Data-name explicitly identifies the data being described. If you specify a data-name, it identifies a data item used in the program. The data-name must be the first word following the level-number.
FILLER is a data item that is not explicitly referred to in a program. If you specify FILLER (an optional keyword), it must be the first word following the level-number.
If you omit the data-name or the keyword FILLER, the data item being described is treated as though FILLER had been specified.
The BLANK WHEN ZERO clause is not allowed for items described with the USAGE IS INDEX clause or the USAGE IS POINTER clause.
->->---BLANK*----*----ZERO---------><- *WHEN*
You can specify the JUSTIFIED clause for alphanumeric-edited items, but not for numeric or numeric-edited items.
When you specify the JUSTIFIED clause for a receiving item, the data is aligned at the rightmost character position in the receiving item. Also:
You cannot specify the JUSTIFIED clause:
The JUSTIFIED clause does not affect initial values, as determined by the VALUE clause.
->->---*--JUSTIFIED--*-*-----*---><- *--JUST-------* *RIGHT*
An item whose usage is POINTER can contain an OCCURS clause, or be subordinate to an item declared with an OCCURS clause.
The OCCURS clause cannot be specified in a data description entry that has a level number of 01, 66, 77, or 88. The OCCURS clause has two formats:
Format 1 (Fixed-Length Tables) ->->--OCCURS integer-2-*-------*----------------> *-TIMES-* *---------------------------------------------* V + ->-*---------------------------------------------*----------> + *-----------* + + V + + *-*-ASCENDING--*-*-----**----*--data-name-2-*-* *-DESCENDING-* *-KEY-**-IS-* ->-*--------------------------------*-----------------------><- + *------------* + + V + + *-INDEXED-*----*-index-name-1-*--* *-BY-*
Integer-2 represents the exact number of occurrences. Integer-2 must be between 1 and 3 000 000 bytes.
Data-name-2 must be the name of the subject entry, or the name of an entry subordinate to the subject entry.
If data-name-2 names the subject entry, that entire entry becomes the ASCENDING/DESCENDING KEY, and is the only key that may be specified for this table element.
If data-name-2 does not name the subject entry, then data-name-2:
With the ASCENDING/DESCENDING KEY phrase, data is arranged in ascending or descending order, depending on the keyword specified, according to the values contained in data-name-2. The data-names are listed in their descending order of significance.
When you specify the ASCENDING/DESCENDING KEY phrase, the following rules apply:
INDEXED: The INDEXED BY phrase specifies the indexes that can be used with this table. The INDEXED BY phrase is required if you use indexing to refer to this table element.
index-name-1: Index-name-1 must follow the rules for the formation of user-defined words. At least 1 character must be alphabetic.
Each index-name specifies an index to be created by the compiler for use by the program. These index-names are not data-names and are not identified elsewhere in the COBOL program. Instead, they can be regarded as private special registers for the use of this object program only. As such, they are not data, or part of any data hierarchy. Each index-name must be unique.
Format 2 (Variable-Length Tables) ->->--OCCURS--integer-1 TO integer-2---*-------*-------------> *-TIMES-* ->--DEPENDING-*----*data-name-1----------------------------> *-ON-* *---------------------------------------------* V + ->---*---------------------------------------------*--------> + *-----------* + + V + + *-*-ASCENDING--*-*-----**----*-data-name-2-*-* *-DESCENDING-* *-KEY-**-IS-* ->---*--------------------------------*---------------------><- + *------------* + + V + + *-INDEXED-*----*-index-name-1-*--* *-BY-*
Integer-1 represents the minimum number of occurrences. Integer-1 must be greater than or equal to zero and less than integer-2.
Integer-2 represents the maximum number of occurrences. Integer-2 must be no more than 32 767.
The OCCURS DEPENDING ON clause specifies variable-length tables.
The object of the OCCURS DEPENDING ON clause must not occupy any storage position within the range of any table, that is, any storage position from the first character position in the table through the last character position in the table.
Data-name-1 specifies the object of the OCCURS DEPENDING ON clause, that is, the data item whose current value represents the current number of occurrences of the subject item.
The PICTURE character string, which may contain a maximum of 30 characters, is made up of certain COBOL characters used as symbols. The allowable combinations determine the category of the elementary data item.
Allowable characters include: A, B, P, S, V, X, Z, 9, 1, 0, /, , (comma), . (period), +, -, CR, DB, *, and $.
->->---*--PICTURE-*-----*----*--character-string--------------><- *--PIC-----* *-IS-*
The level-numbers of data-name-1 and data-name-2 must be identical and must not be level 66 or level 88.
->->--level-number--*---------------*-REDEFINES data-name-2---><- *--data-name-1--* *--FILLER-------*
Data-name-1, FILLER identifies an alternate description for the same area and is the redefining item or the REDEFINES subject.
Data-name-2 is the redefined item or the REDEFINES object.
FILLER identifies an alternate description for the same area and is the redefining item or the REDEFINES subject.
Specifying FILLER does not affect the running of the program; the program runs as though nothing were specified.
When you specify the REDEFINES clause, it must immediately follow data-name or FILLER, if either is specified. If you do not specify data-name or FILLER, the REDEFINES clause must immediately follow the level-number.
You cannot use the LIKE clause to:
You can specify one or more other clauses before or after the LIKE clause:
You can specify BLANK WHEN ZERO only if it has not previously been inherited.
You cannot use the LIKE clause with:
->->------LIKE---data-name---*-----------*-----------------><- *-(integer)-*
Data-name refers to an elementary item, a group item, or an index-name.
Integer specifies the difference in length between the new and existing items. If a blank or a + precedes the integer, the new item is longer. If a - precedes the integer, the new item is shorter.
->->--*--------------*-*-LEADING--*-*--------------------*----><- *-SIGN--*----*-* *-TRAILING-* *SEPARATE-*---------*-* *-IS-* *CHARACTER*
If you specify the SEPARATE CHARACTER phrase:
If you do not specify the SEPARATE CHARACTER phrase:
->->---*--SYNCHRONIZED--*--*---------*------------------------><- *--SYNC----------* *--LEFT---* *--RIGHT--*
The effect of the SYNCHRONIZED clause is dependent on the USAGE you specify
for an item.
If the USAGE is... The SYNCHRONIZED clause...
DISPLAY is syntax-checked but does not affect execution
PACKED-DECIMAL is syntax-checked but does not affect execution
COMPUTATIONAL-3 is syntax-checked but does not affect execution
BINARY:
PIC S9(1) through S9(4) aligns the data item at a multiple of 2 relative
to the beginning of the record
PIC S9(5) through S9(18) aligns the data item at a multiple of 4 relative
to the beginning of the record
COMPUTATIONAL-4 functions the same as for USAGE BINARY
COMPUTATIONAL is syntax-checked but does not affect execution
INDEX is not permitted
The LEFT phrase specifies that the elementary item is to be positioned so that it will begin at the left character position of the natural boundary in which the elementary item is placed.
When specified, the LEFT phrase is syntax checked, but has no effect on the execution of the program.
The RIGHT phrase specifies that the elementary item is to be positioned so that it will terminate at the right character position of the natural boundary in which it has been placed.
When specified, the RIGHT phrase is syntax-checked, but has no effect on the execution of the program.
You can specify the USAGE clause for a data description entry at any level. However, if you specify USAGE at the group level, USAGE applies to each elementary item in the group. The usage of an elementary item must not contradict the usage of a group to which the elementary item belongs.
The USAGE clause specifies the format in which data is represented in storage. The format may be restricted if certain Procedure Division statements are used.
When you do not specify the USAGE clause at either the group or elementary level, it is assumed that usage is DISPLAY.
->->---*------------*--*--BINARY-----------*---><- *--USAGE-*--** *--COMPUTATIONAL----* *IS* *--COMP-------------* *--COMPUTATIONAL-3--* *--COMP-3-----------* *--COMPUTATIONAL-4--* *--COMP-4-----------* *--DISPLAY----------* *--INDEX------------* *--PACKED-DECIMAL---* *--POINTER----------*
Specify BINARY for binary data items. Such items have a decimal equivalent consisting of the decimal digits 0 through 9, plus a sign. Negative numbers are represented as the two's complement of the positive number with the same absolute value.
Specify the PACKED-DECIMAL clause for internal decimal items. Such items appear in storage in packed decimal format. There are 2 digits for each character position, except for the trailing character position, which is occupied by the low-order digit and the sign. Such an item may contain any of the digits 0 through 9, plus a sign, representing a value not exceeding 18 decimal digits.
Specify the COMPUTATIONAL phrase for internal decimal items. Such an item appears in storage as 2 digits per byte, with the sign contained in the 4 rightmost bits of the rightmost byte. An internal decimal item can contain any of the digits 0 through 9 plus a sign. If the PICTURE of an internal decimal item does not contain an S, the sign is occupied by a bit configuration that is interpreted as positive.
COMPUTATIONAL-3 or COMP-3 (internal decimal) is the equivalent of PACKED-DECIMAL.
COMPUTATIONAL-4 or COMP-4 (binary) is the equivalent of BINARY.
DISPLAY specifies that the data item is stored in character form, 1 character for each 8-bit byte. USAGE IS DISPLAY is valid for items that are:
A data item defined with the INDEX phrase is an index data item.
An index data item is a 4-byte elementary item (not necessarily connected with any table) that you can use to save index-name values for future reference. You can use the SET statement to assign an index-name value to an index data item.
A data item defined with the POINTER phrase is a pointer data item.
A pointer data item is a 4-byte elementary item that may be used to accomplish limited base addressing. Pointer data items may be compared for equality or moved to other pointer data items.
You may only use a pointer data item:
The POINTER phrase may be specified for data items with any level number except level 88.
If the item is numeric, all VALUE clause literals must be numeric.
All numeric literals in a VALUE clause of an item must have a value that is within the range of values indicated by the PICTURE clause for that item.
If the item is an elementary or group alphabetic, alphanumeric, alphanumeric-edited, or numeric-edited item, the VALUE clause literal must be nonnumeric.
If the item is Boolean, the VALUE clause must be a Boolean literal.
Literal VALUE Clause ->->---VALUE--*----*--literal---------------------------------><- *-IS-*
Condition-Name VALUE Clause (Level-88 Entry) ->->---88 condition-name--*-VALUE--*----*---*------------------> + *-IS-* + *-VALUES-*-----*--* *-ARE-* *-------------------------------------* V + ->----literal-1----*------------------------*--.-----------><- **-THROUGH-*--literal-2--* *-THRU----*
A condition-name is a user-specified name that associates a single value, multiple values, and/or ranges of values with a conditional variable.
A conditional variable is a data item that can assume one or more values that can in turn be associated with a condition-name.
When you specify literal-1 alone, the condition-name is associated with a single value.
When you specify THROUGH literal-2, the condition-name is associated with at least one range of values, and literal-1 must be less than literal-2.
You can specify VALUE IS NULL only for elementary items that are described implicitly or explicitly as USAGE IS POINTER.
NULL Value Clause ->->---VALUE*--*-*--NULL---*----><- *IS* *--NULLS--*
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.