3
Handling Nonnumeric Data
Nonnumeric data in Compaq COBOL is evaluated with respect to a specified
collating sequence of the operands.
Information to be found in this chapter:
•
How the compiler stores nonnumeric data (Section 3.1)
•
Data organization (Section 3.2)
•
Special characters (Section 3.3)
•
Testing nonnumeric items (Section 3.4)
•
Data movement (Section 3.5)
•
Using the MOVE statement (Section 3.6)
3.1 Storage of Nonnumeric Data
COBOL programs hold their data in items whose sizes are described in their
source programs. The size of these items is thus fixed during compilation for the
lifespan of the resulting object program.
Items in a COBOL program belong to any of the following three data classes:
•
Numeric—Can contain only numeric values.
•
Alphabetic—Can contain only A to Z (uppercase or lowercase) and space
characters.
•
Alphanumeric—Can contain the following types of values:
All alphabetic
All numeric
A mixture of alphabetic and numeric
Any character from the ASCII character set
The data description of an item specifies which class that item belongs to.
Classes are further subdivided into categories. Alphanumeric items can be
numeric edited, alphanumeric edited, or alphanumeric. Every elementary item,
except for an index data item, belongs to one of the classes and its categories.
The class of a group item is treated as alphanumeric regardless of the classes of
subordinate elementary items.
If the data description of an alphanumeric item specifies that certain editing
operations be performed on any value that is moved into it, that item is called an
alphanumeric edited item.
As you read this chapter, keep in mind the distinction between the class or
category of a data item and the actual value that the item contains.
Handling Nonnumeric Data 3–1
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......