The allowable combinations of PICTURE symbols determine the data category of the item:
Note: Category internal floating point is defined by a USAGE clause that specifies the COMP-1 or COMP-2 phrase.
The PICTURE character-string can contain only the symbol A.
The content of the item must consist only of letters of the Latin alphabet and the space character.
Types of numeric items are:
The type of a numeric item is defined by the usage clause as shown in the table below.
| Type | USAGE clause |
|---|---|
| Binary | BINARY, COMP, COMP-4, or COMP-5 |
| Internal decimal | PACKED-DECIMAL, COMP-3 |
| Zoned decimal (external decimal) | DISPLAY |
| National decimal (external decimal) | NATIONAL |
For numeric date fields, the PICTURE character-string can contain only the symbols 9 and S. For all other numeric fields, the PICTURE character-string can contain only the symbols 9, P, S, and V.
The symbol S can be written only as the leftmost character in the PICTURE character-string.
The symbol V can be written only once in a given PICTURE character-string.
For binary items, the number of digit positions must range from 1 through 18 inclusive. For packed decimal and zoned decimal items the number of digit positions must range from 1 through 18, inclusive, when the ARITH(COMPAT) compiler option is in effect, or from 1 through 31, inclusive, when the ARITH(EXTEND) compiler option is in effect.
For numeric date fields, the number of digit positions must match the number of characters specified by the DATE FORMAT clause.
If unsigned, the contents of the item in standard data format must contain a combination of the Arabic numerals 0-9. If signed, it can also contain a +, -, or other representation of the operational sign.
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 USAGE of the item can be DISPLAY, NATIONAL, BINARY, COMPUTATIONAL, PACKED-DECIMAL, COMPUTATIONAL-3, COMPUTATIONAL-4, or COMPUTATIONAL-5.
For signed numeric items described with usage NATIONAL, the SIGN IS SEPARATE clause must be specified or implied.
The NUMPROC and TRUNC compiler options can affect the use of numeric data items. For details, see the Enterprise COBOL Programming Guide.
The PICTURE character-string can contain the following symbols:
B P V Z 9 0 / , . + - CR DB * cs
The combinations of symbols allowed are determined from the PICTURE clause symbol order allowed (see the figure in Symbols used in the PICTURE clause), and the editing rules (see PICTURE clause editing).
The following rules apply:
B / Z 0 , . * + - CR DB cs
+ - CR DB
USAGE DISPLAY or NATIONAL must be specified or implied.
If the usage of the item is DISPLAY, any associated VALUE clause must specify an alphanumeric literal or a figurative constant. The value is assigned without editing.
If the usage of the item is NATIONAL, any associated VALUE clause must specify an alphanumeric literal, a national literal, or a figurative constant. The value is assigned without editing.
The PICTURE character-string must consist of either of the following:
The item is treated as if the character-string contained only the symbol X.
The contents of the item in standard data format can be any allowable characters from the character set of the computer.
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 must be two or more characters from the character set of the computer.
USAGE DISPLAY must be specified or implied.
Any associated VALUE clause must specify an alphanumeric literal or or one of the following figurative constants:
The literal is treated exactly as specified; no editing is done.
The PICTURE character-string can contain the symbols G, G and B, or N. Each G, B, or N represents a single DBCS character position.
Any associated VALUE clause must contain a DBCS literal, the figurative constant SPACE, or the figurative constant ALL DBCS-literal.
The PICTURE character-string can contain one or more occurrences of the picture symbol N.
These rules apply when the NSYMBOL(NATIONAL) compiler option is in effect or the USAGE NATIONAL clause is specified. In the absence of a USAGE NATIONAL clause, if the NSYMBOL(DBCS) compiler option is in effect, picture symbol N represents a DBCS character and the rules of the PICTURE clause for a DBCS item apply.
Each N represents a single national character position.
Any associated VALUE clause must specify an alphanumeric literal, a national literal, or one of the following figurative constants:
Only the NATIONAL phrase can be specified in the USAGE clause. When PICTURE symbol N is used and the NSYMBOL(NATIONAL) compiler option is in effect, USAGE NATIONAL is implied if the usage clause is omitted.
The following clauses can be used:
The following clauses cannot be used:
The PICTURE character-string must contain the following:
Each symbol represents a single national character position.
Any associated VALUE clause must specify an alphanumeric literal, a national literal, or one of the following figurative constants:
The literal is treated exactly as specified; no editing is done.
The NSYMBOL(NATIONAL) compiler option has no effect on the definition of a data item of category national-edited.
A + sign indicates that a positive sign will be used in the output to represent positive values and that a negative sign will represent negative values.
A - sign indicates that a blank will be used in the output to represent positive values and that a negative sign will represent negative values.
Each sign position occupies one byte of storage.
9 . V
An actual decimal point can be represented with a period (.) while an assumed decimal point is represented by a V.
Either an actual or an assumed decimal point must be present in the mantissa; the decimal point can be leading, embedded, or trailing.
The mantissa can contain from 1 to 16 numeric characters.
Example: Pic -9v9(9)E-99
The DISPLAY phrase of the USAGE clause and a floating-point picture character-string define the item as a display floating-point data item.
The NATIONAL phrase of the USAGE clause and a floating-point picture character-string define the item as a national floating-point data item.
For items defined with usage DISPLAY, each picture symbol except V defines one alphanumeric character position in the item.
For items defined with usage NATIONAL, each picture symbol except V defines one national character position in the item.
The DISPLAY phrase or the NATIONAL phrase of the USAGE clause must be specified or implied.
The OCCURS, REDEFINES, and RENAMES 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 invalid with external floating-point items: