DOLLARXw.d Format

Writes numeric values with a leading dollar sign, a period that separates every three digits, and a comma that separates the decimal fraction.

Category: Numeric
Alignment: Right
Interaction: When the DECIMALCONV= system option is set to STDIEEE, the output that is written using this format might differ slightly from previous releases. For more information, see DECIMALCONV= System Option in SAS System Options: Reference.

Syntax

DOLLARXw.d

Syntax Description

w

specifies the width of the output field.

Default 6
Range 2–32

d

specifies the number of digits to the right of the decimal point in the numeric value. This argument is optional.

Default 0
Range 0–31
Requirement must be less than w

Details

The DOLLARXw.d format writes numeric values with a leading dollar sign, with a period that separates every three digits, and with a comma that separates the decimal fraction.
The hexadecimal representation of the code for the dollar sign character ($) is 5B on EBCDIC systems and 24 on ASCII systems. The monetary character that these codes represent might be different in other countries, but DOLLARXw.d always produces one of these codes. If you need another monetary character, define your own format with the FORMAT procedure. See For details, see FORMAT Procedure in Base SAS Procedures Guide.

Comparisons

  • The DOLLARXw.d format is similar to the DOLLARw.d format, but the DOLLARXw.d format reverses the roles of the decimal point and the comma. This convention is common in European countries.
  • The DOLLARXw.d format is the same as the COMMAXw.d format except that the COMMAw.d format does not write a leading dollar sign.

Example

put @3 netpay dollarx10.2;
Value of netpay
Result
----+----1----+
1254.71
   $1.254,71