Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5-14
RENAMES Clause
•
You can use a REDEFINES clause to redefine a PIC N field, which allows only
double-byte data, as an alphanumeric PIC X field. Doing so makes it possible to
move double-byte data items to alphanumeric data items. For example:
WORKING-STORAGE SECTION.
:
01 WS-KANJI-ONLY-FIELD PIC N(10)
01 WS-KANJI-TO-PIC-X-REDEF REDEFINES WS-KANJI-ONLY
FIELD PIC X(20)
The REDEFINES clause redefines a storage area, not the data items occupying the area.
Multiple redefinition of the same area is permitted, but all definitions must begin with a
REDEFINES clause containing the data name of the entry that originally defined the
area.
The following example illustrates the REDEFINES clause:
WORKING-STORAGE SECTION.
01 record-in.
05 record-code PIC 9.
05 record-detail PIC X(30).
05 record-subtotal PIC 9(3)V99.
01 record-total REDEFINES record-in.
05 total-1 PIC 9(5)V99.
05 total-2 PIC 9(5)V99.
05 total-3 PIC 9(5)V99.
05 total-4 PIC 9(5)V99.
05 total-5 PIC 9(6)V99.
05 total-5-sub REDEFINES total-5 PIC X(8).
RENAMES Clause
The RENAMES clause assigns a new data name to one or more contiguous elementary
items within a data description. RENAMES does not cause any allocation of storage.
The clause can only be used with a level 66 entry.
new-name
is the new name for a group item or elementary item.
old-name
is a group item, an elementary item, or the first of several items to be given a new
name.
end-name
is the last group item or elementary item to be included in the new name.
66 new-name RENAMES old-name [ { THROUGH } end-name ] .
[ { THRU } ]