CURRENCY SIGN clause
The CURRENCY SIGN clause affects numeric-edited data items whose PICTURE character-strings contain a currency symbol.
A currency symbol represents a currency sign value that is:
- Inserted in such data items when they are used as receiving items
- Removed from such data items when they are used as sending items for a numeric or numeric-edited receiver
Typically, currency sign values identify the monetary units stored in a data item. For example: '$', 'EUR', 'CHF', 'JPY', 'HK$', 'HKD', or X'9F' (hexadecimal code point in some EBCDIC code pages for €, the Euro currency sign). For details on programming techniques for handling the Euro, see Using currency signs in the Enterprise COBOL Programming Guide.
The CURRENCY SIGN clause specifies a currency sign value and the currency symbol used to represent that currency sign value in a PICTURE clause.
The SPECIAL-NAMES paragraph can contain multiple CURRENCY SIGN clauses. Each CURRENCY SIGN clause must specify a different currency symbol. Unlike all other PICTURE clause symbols, currency symbols are case sensitive. For example, 'D' and 'd' specify different currency symbols.
- CURRENCY SIGN IS literal-6
- literal-6 must be an alphanumeric literal. literal-6 must
not be a figurative constant or a null-terminated literal. literal-6 must
not contain a DBCS character.
If the PICTURE SYMBOL phrase is not specified, literal-6:
- Specifies both a currency sign value and the currency symbol for this currency sign value
- Must be a single character
- Must not contain any of the following digits or characters:
- Digits 0 through 9
- Alphabetic characters A, B, C, D, E, G, N, P, R, S, U, V, X, Z, their lowercase equivalents, or the space
- Special characters + - , . * / ; ( )
"
='
(plus sign, minus sign, comma, period, asterisk, slash, semicolon, left parenthesis, right parenthesis, quotation mark, equal sign, apostrophe)
- Can be one of the following lowercase alphabetic characters: f, h, i, j, k, l, m, o, q, t, w, y
If the PICTURE SYMBOL phrase is specified, literal-6:
- Specifies a currency sign value. literal-7 in the PICTURE SYMBOL phrase specifies the currency symbol for this currency sign value.
- Can consist of one or more characters.
- Must not contain any of the following digits or characters:
- Digits 0 through 9
- Special characters + - . ,
- PICTURE SYMBOL literal-7
- Specifies a currency symbol that can be used in a PICTURE clause
to represent the currency sign value specified by literal-6.
literal-7 must be an alphanumeric literal consisting of one single-byte character. literal-7 must not contain any of the following digits or characters:
- A figurative constant
- Digits 0 through 9
- Alphabetic characters A, B, C, D, E, G, N, P, R, S, U, V, X, Z, their lowercase equivalents, or the space
- Special characters + - , . * / ; ( )
"
='
If the CURRENCY SIGN clause is specified, the CURRENCY and NOCURRENCY compiler options are ignored. If the CURRENCY SIGN clause is not specified and the NOCURRENCY compiler option is in effect, the dollar sign ($) is used as the default currency sign value and currency symbol. For more information about the CURRENCY and NOCURRENCY compiler options, see CURRENCY in the Enterprise COBOL Programming Guide.