A currency symbol can be used as a picture character denoting a character value of numeric character data. This symbol can be the dollar sign ($) or any symbol you choose. The symbol can be any sequence of characters enclosed in < and > characters.
|
More than one > indicates a drifting string (discussed in ***).
Examples of general insertion strings include the following:
If the character < or > must be included in the sequence, it must be preceded by another <. Therefore, < acts as an escape character also.
The entire sequence enclosed in < > represents one "symbol" and therefore represents the character value for one numeric character. If the symbol needs to be represented as a drifting picture character, you specify > following the "< >" to represent each occurrence.
For example:
More examples of currency symbol definition include the following:
dcl P pic'<DM>9.999,V99'; P = 1234.40; /* Yields 'DM1.234,40' */ dcl P pic'<DM>9.999,V99'; P = 34.40; /* Yields 'DM 34,40' */ dcl P pic'<DM>>.>>9,V99'; P = 1234.40; /* Yields 'DM1.234,40' */ dcl P pic'<DM>>.>>9,V99'; P = 34.40; /* Yields ' DM34,40' */ dcl P pic'9.999,V99<K$>'; P = 1234.40; /* Yields '1.234,40K$' */
In this chapter, the term currency symbol and the $ symbol refer to the dollar sign or any user-defined currency symbol.