A currency mask can be used for currency specification in string substitutions for the ON COMPARE statement or the MSUBSTMASK function. The currency mask must be matched to validate and format a value specified in a specific currency on the file or report. The output of a currency mask is a value in the numeric format that is enclosed within the innermost parentheses of the mask. This value is computed in the currency specified to the left of these parentheses.
A currency mask is specified as a substring of the SUBSTTO string in the ON COMPARE statement or MSUBSTMASK function, in the following format:
xxx=(validation mask | format mask[,%yyy=(format mask)])
In this format
xxx – 3-character currency identifier variable, from the currencies defined in the currencies AutoEdit member (see above). It specifies the source currency for conversion input.
yyy – 3-character currency identifier variable, from the currencies defined in the currencies AutoEdit member (see above). It specifies the target currency for conversion output.
mask – validation or format pattern that the input must match, as follows:
+ – positive number sign for formatting
- – negative number sign for formatting
? – any single digit (0-9) for validation
# – any single digit (0-9) for formatting
Z – any single digit (0-9) for formatting – replace leading zeros with blanks
. – decimal point (SYSDECCHAR value dependent)
, – thousands separator (SYSDECCHAR value dependent)