COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-48
FILLER Keyword
FILLER Keyword
The FILLER keyword, explicit or implicit, substitutes for a data-name when it is not
important that an item have a name. It is allowed on elementary or data structures.
Commonly, FILLER is used when you build records in the Working-Storage Section or
Extended-Storage Section for heading lines or error messages, where most of the text
is groups of literals.
Data items designated as FILLER can be conditional data items. This means that a
FILLER item can be followed by one or more level-88 items describing condition-
names that have the value TRUE when the FILLER item contains a certain value.
REDEFINES Clause
The REDEFINES clause enables you to describe the same computer storage area in
more than one way. This can be quite valuable for tasks such as input data validation,
when tests require different descriptions of the data. It is also convenient when some
portions of a record are constant, while other parts vary.
data-name-2
is the name of the existing data item that is being redefined as data-name-1.
In Example 7-11, the two records RECORD-IN and RECORD-TOTAL share the same
storage space, but their fields are different.
Example 7-10. FILLER Keyword
WORKING-STORAGE SECTION.
01 HEAD-1.
05 FILLER PIC X(10) VALUE "PART NUM".
05 FILLER PIC X(25) VALUE "DESCRIPTION".
05 FILLER PIC X(30) VALUE SPACES.
05 FILLER PIC X(15) VALUE "UNITS ON HAND"
01 BAD-NEWS.
02 THE-VALUES.
05 PIC X(45)
VALUE "That part number is invalid.".
05 PIC X(45)
VALUE "That job code is invalid.".
05 PIC X(45)
VALUE "That delivery date is a holiday.".
...
02 THE-MESSAGES REDEFINES THE-VALUES.
05 ERR-MESSAGE PIC X(45) OCCURS 15 TIMES.
REDEFINES
data-name-2
VST102.vsd