Writes negative numeric values in parentheses.
Category: |
Numeric
|
Alignment: |
right
|
-
w
-
specifies the width of the output field.
-
d
-
specifies the number of digits to the right
of the decimal point in the numeric value. This argument is optional.
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 non-negative, 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.
The NEGPARENw.d format is similar to the
COMMAw.d format in that it separates every three digits of the value
with a comma.
put @1 sales negparen8.;
Value of sales |
Results |
|
----+----1----+
|
100
|
100
|
1000
|
1,000
|
-200
|
(200)
|
-2000
|
(2,000)
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.