COMMAXw.d Format
Writes numeric values with 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. |
| Note: | Beginning in 2025.12, this format supports the BIGINT data type when run in the DS2 language. Set BIGINTPROCESSING=YES to ensure that large integer values—stored as BIGINT—are displayed with full precision, up to 19 digits, without rounding or truncation. BIGINTPROCESSING=YES is recommended for large values that exceed 15–16 digits. |
Table of Contents
Syntax
Required Argument
w
specifies the width of the output field.
| Default | 6 |
|---|---|
| Range | 1–32 |
| Tip | Make w wide enough to write the numeric values, the commas, and the optional decimal point. |
Optional Argument
d
specifies the number of digits to the right of the decimal point in the numeric value.
| Range | 0–31 |
|---|---|
| Requirement | must be less than w |
Comparisons
The COMMAw.d format is similar to the COMMAXw.d format, but the COMMAXw.d format reverses the roles of the decimal point and the comma. This convention is common in European countries.
Example
The following program illustrates the COMMAXw. format:
data _null_;
declare varchar(15) a b;
method run();
a=put (23451.23,commax10.2);
b=put (123451.234,commax10.2);
put a= b=;
end;
enddata;
run;
SAS writes the following output to the log.
a= 23.451,23 b=123.451,23
See Also
-
Formats: