COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-62
PICTURE Clause
Alphanumeric Edited Data Items
An item is in the alphanumeric edited category when its PICTURE character-
string consists of at least one X or A and at least one B, zero (0 ), or slash (/).
The contents of the data item can be any combination of characters.
Numeric Edited Data Items
An item is in the numeric edited category when its PICTURE character-string
contains only combinations of the symbols B, slash (/), P, V, Z, zero (0 ), 9, comma
(,), period (.), asterisk (*), plus (+), minus (-), CR, DB, and the currency symbol
(usually the dollar sign ($)). The number of digit positions must be in the range
from 1 through 18. The PICTURE character-string must have at least one symbol
from the listed set other than 9, P, or V.
National Data Items
An item is in the national category when its PICTURE character-string begins with
N or n and contains no editing symbols. A national data item is used for
languages that are not represented by roman letters and numbers, such as the
Japanese Kanji alphabet. Special terminals and keyboards are required to use
national data items.
In general, you can use a national data item anywhere you can use an
alphanumeric data item. Exceptions are:
°
In an ACCEPT statement with DATE, DAY, DAY-OF-WEEK, or TIME
°
In a FILE STATUS clause of the SELECT statement
°
In an INITIALIZE statement with a REPLACING phrase
°
In an INSPECT statement
Example 7-15. Alphanumeric Edited Data Items
10 PART-NAME PIC X(5)BX(5).
15 BRANCH-CODE PIC XX0X.
05 REPORT-VERSION PIC XX/X.
20 SITE-ID PIC A(3)0A.
20 SYSTEM-TAG PIC AA/A.
05 SEAT-NUMBER PIC AB9.
Example 7-16. Numeric Edited Data Items
12 R-TOTAL-1 PIC ZZZ,ZZZ.99.
10 ITEM-PRICE PIC $999.
35 UNIT-PRICE PIC $$$9.
05 AMOUNT-OWED PIC 999CR.
10 AMOUNT-LEFT PIC ***99.
05 BACK-ORDERS PIC -99.
77 START-DATE PIC 99/99/99.
12 S-BLIVIT PIC +$99.99.
03 STARRED-X PIC ***.**.
77 SUM-X PIC --B---.---.