Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Language Reference


Classes and categories of data

Most data and all literals used in a COBOL program are divided into classes and categories. Data classes are groupings of data categories. Data categories are determined by the attributes of data description entries or function definitions, as described in Category descriptions.

The following elementary data items do not have a class and category:

All other types of elementary data items have a class and category as shown in Table 1.

A function references an elementary data item and belongs to the data class and category associated with the type of the function, as shown in Table 2.

Literals have a class and category as shown in Table 3. Figurative constants (except NULL) have a class and category that depends on the literal or value represented by the figurative constant in the context of its use. For details, see Figurative constants.

All group items have a class and category, even if the subordinate elementary items belong to another class and category. For the classification of group items, see Classes and categories of group items.

Table 1. Class, category, and usage of elementary data items
Class Category Usage
Alphabetic Alphabetic DISPLAY
Alphanumeric Alphanumeric DISPLAY
Alphanumeric-edited DISPLAY
Numeric-edited DISPLAY
DBCS DBCS DISPLAY-1
National National NATIONAL
National-edited NATIONAL
Numeric-edited NATIONAL
Numeric Numeric DISPLAY (type zoned decimal)
NATIONAL (type national decimal)
PACKED-DECIMAL (type internal decimal)
COMP-3 (type internal decimal)
BINARY
COMP
COMP-4
COMP-5
Internal floating-point COMP-1
COMP-2
External floating-point DISPLAY
NATIONAL

Table 2. Classes and categories of functions
Function type Class and category
Alphanumeric Alphanumeric
National National
Integer Numeric
Numeric Numeric

Table 3. Classes and categories of literals
Literal Class and category

Alphanumeric
(including hexadecimal formats)

Alphanumeric
DBCS DBCS

National
(including hexadecimal formats)

National

Numeric
(fixed-point and floating-point)

Numeric

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)