Rational Developer for System z
COBOL for Windows, Version 7.5, 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 Classes, categories, and usages of elementary data items (Table 8).

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 Classes and categories of functions (Table 9).

Literals have a class and category as shown in Classes and categories of literals (Table 10). 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 8. 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 9. Classes and categories of functions
Function type Class and category
Alphanumeric Alphanumeric
National National
Integer Numeric
Numeric Numeric

Table 10. 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

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)