Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Defining currency symbols

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.

Read syntax diagramSkip visual syntax diagram        .------.
        V      |
>>- < ----char-+-- > ------------------------------------------><
 
<
Indicates the start of the currency symbol. It acts as an escape character. If you want to use the character <, you must specify <<.
char
Is any character that will be part of your currency symbol(s).
>
indicates the end of the currency symbol. If you want to use the character >, you must specify <>.

More than one > indicates a drifting string (discussed in ***).

Examples of general insertion strings include the following:

<DM>
represents the Deutschemark
<Fr>
represents the French Franc
<K$>
represents the Khalistan Dollar
<Sur.f>
represents the Surinam Guilder
<$>
represents the dollar sign

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:

Pic '<DM>>>.>>9,V99'
represents a 10 character numeric picture, yielding 11 characters after assignment.
Pic '<Sur.f>999,V99'
represents a 7 character numeric picture, yielding 11 characters after assignment.
Pic '<K$>>>,>>9.V99'
represents a 10 character numeric picture, yielding 11 characters after assignment.
Pic '<$>>>,>>9.V99'
represents a 10 character numeric picture, yielding 10 characters after assignment.
Pic '$$$,$$9.V99'
has the same value as the previous picture specification.

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.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)