CURRENCY

CURRENCY determines whether an alternate currency symbol will be used; the default is dollar sign ($).

Syntax

Read syntax diagramSkip visual syntax diagramCURRENCY=*NOliteral
Default
CURRENCY=NO
literal
Represents the default currency symbol that you want to use in your program.
The literal must be an alphanumeric literal (optionally a hexadecimal literal) representing a 1-byte EBCDIC character that must not be any of the following items:
  • Digits zero (0) through nine (9)
  • Uppercase alphabetic characters: A B C D P R S V X Z
  • Lowercase alphabetic characters a through z
  • The space
  • Special characters: * + - / , . ; ( ) = "
  • Uppercase alphabetic character G, if the COBOL program defines a DBCS item with the PICTURE symbol G. The PICTURE clause will not be valid for that DBCS item because the symbol G is considered to be a currency symbol in the PICTURE clause.
  • Uppercase alphabetic character N, if the COBOL program defines a DBCS item with the PICTURE symbol N. The PICTURE clause will not be valid for that DBCS item because the symbol N is considered to be a currency symbol in the PICTURE clause.
  • Uppercase alphabetic character E, if the COBOL program defines an external floating-point item. The PICTURE clause will not be valid for the external floating-point item because the symbol E is considered to be a currency symbol in the PICTURE clause.
The literal (including hex literal) syntax rules are as follows:
  • The literal delimiters can be either quotation marks or apostrophes regardless of whether the APOST or QUOTE option is in effect.
  • When an apostrophe (') is to be the currency sign, the embedded apostrophe must be doubled, that is, two apostrophes must be coded to represent one apostrophe within the literal. For example:
    
    '''' or "''"
    
  • The format for a hex literal specification is as follows:
    
    X'H1H2' or X"H1H2"
    
    where H1H2 is a valid hexadecimal value representing a 1-byte EBCDIC character conforming to the rules for the currency sign literal as described above. Alphabetic characters in the hex literal must be in uppercase.
    Note: Hex values of X'20' or X'21' are not allowed.
NO
Indicates that no alternate default currency sign is provided through the CURRENCY option, and the dollar sign will be used as the default currency sign for the program if the CURRENCY option is not specified at compile time.

The value NO provides the same results for the source program as omitting the CURRENCY SIGN clause in the COBOL source program.

Note:
  • You can use the CURRENCY option as an alternative to the CURRENCY SIGN clause (which is specified in the COBOL source program) for selecting the currency symbol that you use in the PICTURE clause of your COBOL program.
  • When both the CURRENCY option and the CURRENCY SIGN clause are used in a program, the symbol that is specified in the CURRENCY SIGN clause is the currency symbol in a PICTURE clause when that symbol is used, even if the CURRENCY option is fixed (*).