NEGPARENw.d Format

Writes negative numeric values in parentheses.

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

NEGPARENw.[d]

Required Argument

w

specifies the width of the output field.

Default6
Range1–32

Optional Argument

d

specifies the number of digits to the right of the decimal point in the numeric value.

Default0
Range0–31

Details

The NEGPARENw.d format attempts to right align output values. If the input value is negative, NEGPARENw.d displays the output by enclosing the value in parentheses, if the field that you specify is wide enough. Otherwise, it uses a minus sign to represent the negative value. If the input value is nonnegative, NEGPARENw.d displays the value with a leading and trailing blank to ensure proper column alignment. It reserves the last column for a close parenthesis even when the value is positive.

Comparisons

The NEGPARENw.d format is similar to the COMMAw.d format in that it separates every three digits of the value with a comma.

Example

The following program illustrates the NEGPARENw.d format:

data _null_;
   declare char(15) a b c d;
   method run();
      a=put(100,negparen6.);
      b=put(1000,negparen6.);
      c=put(-200,negparen6.);
      d=put(-2000,negparen8.);
      put a= b= c= d=;
   end;
enddata;
run;

SAS writes the following output to the log.

a=  100           b= 1,000          c= (200)          d= (2,000)
Last updated: September 2, 2026