[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
The PICTURE clause specifies the general characteristics and editing requirements of an elementary item, including an elementary screen item.
Category of Receiving Item | PICTURE of Receiving Item | Valid Contents of Sending Item | Examples |
---|---|---|---|
Alphabetic | Must contain one or more As. | One or more alphabetic characters. |
AA
A(9) |
Numeric | Must contain at least one 9. May contain P's, one S, and one V. If USAGE IS COMP-5 or USAGE IS COMP-X, may contain all Xs. | One or more numeric characters. |
S9(4)V99
9PPP SPP9 |
Alphanumeric | Must contain combinations of As, Xs, and 9s. Can be all Xs. Cannot be all As or all 9s. | One or more characters in computer character set. |
XX99XX
AAXA(4) |
Alphanumeric
Edited |
Must contain at least one A or X. Must also contain at least one B, 0, or /. Can contain one or more 9s. | One or more characters in computer character set. |
XXBXXB9(4)
XX/99/00 9(6)/X |
Numeric
Edited |
Must contain at least one 0, B, /, Z, *, +, (comma), ., --, CR, DB, or cs. Can contain Ps, 9s, and one V. Must describe 1 to 31 digit positions, which can be represented by 9s, zero suppression symbols (Z, *), and floating insertion symbols (+, --, cs). | One or more numeric characters. |
*,***.**
ZZ,ZZZ/9(4) $$,$$$DB $9,999CR ZZZCR **.** |
COMP-1 and COMP-2 data items are numeric. However, their data description entries cannot have a PICTURE clause. |
Picture Clause Symbol | Function |
---|---|
A | Represents a character position that can contain only an alphabetic character. An alphabetic character belongs to the set of characters: A to Z, a to z, and the space. |
Can occur more than once. | |
Counts toward the size of the item. | |
B | Represents a character position into which a space is inserted. |
Can occur more than once. | |
Counts toward the size of the item. | |
N | For USAGE IS DISPLAY, represents a character position that can contain any 2-byte character from the national character set. This is available only if /NATIONALITY=JAPAN or -nationality japan is specified. |
P | Specifies an assumed decimal scaling position, defining the location of the decimal point when one is not specified in character-string. |
Can occur more than once, but only as a contiguous string of Ps at either the leftmost or rightmost end (not both) of character-string. The assumed decimal point character (V) is redundant when specified. However, when it is specified, V can appear to the left of the leftmost P or to the right of the rightmost P. | |
Does not count toward the size of the item. However, each P counts toward the maximum number of digit positions (31) in a numeric or numeric edited item. | |
Cannot be used if an explicit decimal point (.) appears in character-string. | |
In certain operations that refer to an item with P characters in
character-string, the compiler treats each P position as if it
contained the value zero. For example, an item with PICTURE 99PPP can
have 100 unique values that range from 0 to 99,000 (0, 1000, 2000, ...,
99,000). An item with PICTURE PP9 can have 10 unique values (0, .001,
.002, ... .009). These operations are any of the following:
|
|
In all other operations, the compiler ignores the digit positions specified with the symbol P and does not count them toward the size of the operand. | |
S | Indicates the presence of an operational sign, but does not specify the sign representation or position. |
Can occur only once, as the leftmost character in character-string. | |
Does not count toward the size of the item unless the data or screen description entry contains a SIGN IS SEPARATE clause. If the SIGN clause does not appear in the item's data description, S is equivalent to SIGN IS TRAILING. | |
V | Specifies the location of the assumed decimal point. |
Can occur only once. | |
Does not count toward the size of the item. | |
Cannot be used if an explicit decimal point (.) appears in the PICTURE. | |
X | For USAGE IS DISPLAY, represents a character position that can contain any character from the computer character set. For USAGE IS COMP-5 or USAGE IS COMP-X, represents a byte of computer storage. |
Can occur more than once. | |
Counts toward the size of the item. | |
Z | Represents a leading digit position that is replaced by a space when its value and the value of the digits to its left are zero. |
Can occur more than once. | |
Counts toward the size of the item. | |
Use of Z excludes the use of the asterisk (*) for zero suppression and replacement. | |
9 | Represents a digit position that can contain only the digits 0 to 9. |
Can occur more than once. | |
Counts toward the size of the item. | |
0 | Represents a character position into which 0 is inserted. |
Can occur more than once. | |
Counts toward the size of the item. | |
/ | Represents a character position into which a slash (/) is inserted. |
Can occur more than once. | |
Counts toward the size of the item. | |
, | Represents a character position into which a comma (,) is inserted. + |
Can occur more than once. | |
Counts toward the size of the item. | |
. | Represents a character position into which a decimal point (.) is inserted. It also represents the decimal point for alignment purposes. + |
Can occur only once. | |
Counts toward the size of the item. | |
Cannot be used if V or P appears in character-string. | |
+ -- | Represents the editing sign control symbols, the plus sign (+) and minus sign (-). |
Each can occur more than once. | |
Each counts as one character toward the size of the item. | |
character-string can contain either a plus sign (+) or minus (-), but not both. Also, the use of either character excludes the use of both CR and DB. | |
CR DB | Represents the editing sign control symbols, credit (CR) and debit (DB). |
Each can occur only once, as the two rightmost character positions. | |
Each counts as two characters toward the size of the item. | |
character-string can contain either CR or DB, but not both. Also, the use of either excludes the use of the plus sign (+) and minus sign (-) as fixed insertion characters. | |
* | Represents a leading digit position that is replaced by an asterisk (*) when its value and the values of all digit positions to its left are zero. |
Can occur more than once. | |
Counts toward the size of the item. | |
Use of an asterisk (*) excludes the use of Z for zero suppression and replacement. | |
cs | Represents a character position into which the currency symbol is inserted. This symbol is either the currency sign ($) or the character specified in the CURRENCY SIGN clause of the SPECIAL-NAMES paragraph or (on OpenVMS) the character specified at DCL command level in the definition of the SYS$CURRENCY logical name. |
Can occur more than once. | |
Counts as one character toward the size of the item. |
Previous | Next | Contents | Index |