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.

Syntax

COMMAX[w.d]

Required Argument

w

specifies the width of the output field.

Default6
Range1–32
TipMake 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.

Range0–31
Requirementmust 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

Last updated: September 2, 2026