ILE COBOL Language Reference

Classes and Categories of Data

Most data used in a COBOL program can be divided into classes and categories, except pointers, procedure-pointers, and index data items.

Every elementary item in a program belongs to one of the classes as well as one of the categories. Every group item belongs to the alphanumeric class even if the subordinate elementary items belong to another class and category. Table 9 shows the relationship of data classes and categories.

The data category of an item is determined by its PICTURE character-string, BLANK WHEN ZERO, and USAGE attribute. For details, see Data Categories and PICTURE Rules.

+-------------------------------IBM Extension--------------------------------+

The data category of an item can also be determined by its FORMAT clause. A FORMAT clause defines category date, time, and timestamp items.

Boolean data is an IBM extension that provides a means of modifying and passing the values of the indicators associated with the display screen formats and externally described printer files. A Boolean value of 0 is the off status of the indicator, and a Boolean value of 1 is the on status of the indicator.

A Boolean literal contains a single 0 or 1, is enclosed in quotation marks, and is immediately preceded by an identifying B. A Boolean literal is defined as either B"0" or B"1".

A Boolean character occupies one byte.

When the figurative constant ZERO is associated with a Boolean data item or a Boolean literal, it represents the Boolean literal B"0".

The reserved word ALL is valid with a Boolean literal.

+----------------------------End of IBM Extension----------------------------+

Related Information:

Every data item that is an intrinsic function is an elementary item, and belongs to the category alphanumeric, numeric, DBCS, national, boolean, date, time, or timestamp and to the corresponding class; the category of each intrinsic function is determined by the definition of the function.

Classes and Categories of Data


Table 9. Classes and Categories of Data

Level of Item Class Category
Elementary Alphabetic Alphabetic
Numeric Numeric
Internal Floating-Point1
External Floating-Point1
Alphanumeric Numeric Edited
Alphanumeric Edited
Alphanumeric
Date-Time1 Date1
Time1
Timestamp1
Boolean1 Boolean1
DBCS1 DBCS1
DBCS-edited1
National1 National1
Group Alphanumeric Alphabetic
Numeric
Internal Floating-Point1
External Floating-Point1
Numeric Edited
Date1
Time1
Timestamp1
Alphanumeric Edited
Alphanumeric
Boolean1
DBCS1
DBCS-edited1
National1
Note:
1 IBM Extension


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]