COBOL Manual for TNS and TNS/R Programs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
4-1
4 Data Fundamentals
Every data item in a COBOL program has a level, class and category. Data items are
organized into data structures. How data is represented depends on the machine on
which it executes. Not all data storage locations in a COBOL program are the same
size. When you direct a COBOL program to store a value of a given size at a location
of a different size, the process extends or truncates the value according to a set of
alignment rules. Alignment considerations sometimes cause the compiler to allocate
unused bytes between data items, which are called implicit FILLER data. COBOL
provides several ways to refer to individual data items in a program.
Topics:
•
Data Levels, Classes, and Categories
•
Data Structures
•
Data Representation
•
Data Alignment in Receiving Items
•
Data Alignment in Memory
•
Implicit FILLER Bytes
•
References to Data Items
Data Levels, Classes, and Categories
COBOL has two data levels: elementary item and data structure. An elementary item
cannot be subdivided; a data structure can be subdivided (see Data Structures).
Data items fall into the classes and categories shown in Table 4-1. The categories are
used in PICTURE Clause.
Table 4-1. Data Levels, Classes, and Categories
Level of Item Class Category
Elementary Alphabetic Alphabetic
Numeric Numeric
Alphanumeric Alphanumeric
Alphanumeric Edited
Numeric Edited
National National
Pointer Pointer
Data structure Alphanumeric Alphanumeric