ILE COBOL Language Reference
The allowable combinations of PICTURE symbols determine the data category
of the item.
- Note:
- If the LOCALE phrase is specified in a PICTURE clause, the category of data
defined by that PICTURE clause is numeric-edited only.
- The PICTURE character-string can contain only the symbol A.
- The contents of the item in standard data format must consist of any of
the letters of the English alphabet and the space character.
- USAGE DISPLAY must be specified or implied.
- Any associated VALUE clause must specify a nonnumeric literal containing
only alphabetic characters or the figurative constant SPACE.
- Types of numeric items are:
- Binary
- Packed decimal (internal decimal)
- Zoned decimal (external decimal).
- The PICTURE character-string can contain only the symbols 9, P, S, and
V.
- The number of digit positions must range from 1 through 18,
inclusive.
+-------------------------------IBM Extension--------------------------------+
- For packed and zoned decimal numeric items, the number of digit positions
can range from 1 through 63, inclusive.
+----------------------------End of IBM Extension----------------------------+
- If unsigned,
the contents of the item in standard data format must contain a combination
of the Arabic numerals 0-9. If signed,
it may also contain a +, -, or other representation of the operational
sign.
- The USAGE of the item can be DISPLAY, BINARY, COMPUTATIONAL, or
PACKED-DECIMAL.
+-------------------------------IBM Extension--------------------------------+
- The USAGE of the item can be COMPUTATIONAL-3 or
COMPUTATIONAL-4.
+----------------------------End of IBM Extension----------------------------+
- A VALUE clause associated with an elementary numeric item must specify a
numeric literal or the figurative constant ZERO. A VALUE clause
associated with a group item consisting of elementary numeric items must
specify a nonnumeric literal or a figurative constant, because the
group is considered alphanumeric. In both cases, the literal is treated
exactly as specified; no editing is performed.
Examples of numeric items:
PICTURE Valid Range of Values
9999 0 through 9999
S99 -99 through +99
S999V9 -999.9 through +999.9
PPP999 0 through .000999
S999PPP -1000 through -999000 and
+1000 through +999000 or zero
- The PICTURE character-string can contain the following symbols:
B P V Z 9 0 / , . + - CR DB * $
The combinations of symbols allowed are determined from the PICTURE clause
symbol order allowed (see Figure 7), and the editing rules (see PICTURE Clause Editing). The following additional rules also
apply:
- Either the BLANK WHEN ZERO clause must be specified for the item, or the
string must contain at least one of the following symbols:
B / Z 0 , . * + - CR DB $
- The number of digit positions represented in the character-string must be
in the range 1 through 18, inclusive.
+-------------------------------IBM Extension--------------------------------+
- The number of digit positions represented in the character-string must be
in the range 1 through 63, inclusive.
+----------------------------End of IBM Extension----------------------------+
- The total length of the resultant character positions must be 127 or
less.
- The contents of those character positions representing digits in standard
data format must be one of the 10 Arabic numerals.
- USAGE DISPLAY must be specified or implied.
- Any associated VALUE clause must specify a nonnumeric literal or a
figurative constant. The literal is treated exactly as specified;
no editing is done.
+-------------------------------IBM Extension--------------------------------+
+----------------------------End of IBM Extension----------------------------+
- The PICTURE character-string must consist of either of the
following:
- The symbol X
- Combinations of the symbols A, X, and 9. (A character-string
containing all As or all 9s does not define an alphanumeric item.)
- The item is treated as if the character-string contained only the symbol
X.
- The contents of the item in standard data format may be any allowable
characters from the EBCDIC character set.
- USAGE DISPLAY must be specified or implied.
- Any associated VALUE clause must specify a nonnumeric literal or a
figurative constant.
- The PICTURE character-string can contain the following symbols:
A X 9 B 0 /
- The string must contain at least one A or X, and at least one B or 0
(zero) or /.
- The contents of the item in standard data format may be any allowable
character from the EBCDIC character set.
- The total length of the resultant character positions must be 127 or
less.
- USAGE DISPLAY must be specified or implied.
- Any associated VALUE clause must specify a nonnumeric literal or a
figurative constant. The literal is treated exactly as specified;
no editing is done.
+-------------------------------IBM Extension--------------------------------+
The following rules apply:
- The PICTURE character-string can contain only the symbol 1.
- Only one character 1 can be specified.
- The USAGE of an item can only be DISPLAY.
- An associated VALUE clause must specify a Boolean literal (B"1" or
B"0") or zero.
- The following clauses cannot be specified for a Boolean item:
- SIGN clause
- BLANK WHEN ZERO clause
- ASCENDING/DESCENDING KEY clause.
- The INDICATOR clause can be specified.
(See the ILE COBOL for AS/400 Programmer's
Guide for more information about
indicators.)
+----------------------------End of IBM Extension----------------------------+
+-------------------------------IBM Extension--------------------------------+
- The PICTURE character-string can contain the symbol(s) G or N.
- Each G or N represents a single DBCS character position (2 bytes).
- When PICTURE clause symbol G is used, USAGE DISPLAY-1 must be
specified.
- When PICTURE clause symbol N is used, USAGE DISPLAY-1 must be
implicitly or explicitly specified.
- Associated VALUE clauses must specify a DBCS literal or the figurative
constant SPACE/SPACES.
+----------------------------End of IBM Extension----------------------------+
+-------------------------------IBM Extension--------------------------------+
- The PICTURE character-string is a combination of G's and B's
with at least one of each.
- Each G, and B represents a single DBCS character position (2
bytes).
- USAGE DISPLAY-1 must be specified.
- Associated VALUE clauses must specify a DBCS literal or the figurative
constant SPACE/SPACES.
+----------------------------End of IBM Extension----------------------------+
+-------------------------------IBM Extension--------------------------------+
- The PICTURE character-string can contain the symbol(s) N.
- Each N represents a single UCS-2 character.
- When PICTURE clause symbol N is used, USAGE NATIONAL must be implicitly or
explicitly specified.
- Associated VALUE clauses must specify a national hexadecimal literal or
the figurative constant SPACE/SPACES.
+----------------------------End of IBM Extension----------------------------+
+-------------------------------IBM Extension--------------------------------+
- The OCCURS, REDEFINES, LIKE, RENAMES, and TYPEDEF clauses can be
associated with external floating-point items.
- The SIGN clause is accepted as documentation and has no effect on the
representation of the sign.
- The SYNCHRONIZED clause is treated as documentation.
- The following clauses are not valid with external floating-point
items:
- BLANK WHEN ZERO
- JUSTIFIED
- VALUE
+----------------------------End of IBM Extension----------------------------+
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.