PERCENTNw.d Format

Produces percentages, using a minus sign for negative values.

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

PERCENTNw.d

Syntax Description

w

specifies the width of the output field.

Default 6
Range 4–32
Tip The width of the output field must account for the minus sign ( – ), the percent sign ( % ), and a trailing blank, whether the number is negative or positive.

d

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

Range 0–31
Requirement must be less than w

Details

The PERCENTNw.d format multiplies negative values by 100, formats them the same as the BESTw.d format, adds a minus sign to the beginning of the value, and adds a percent sign (%) to the end of the formatted value.

Comparisons

The PERCENTNw.d format produces percents by using a minus sign instead of parentheses for negative values. The PERCENTw.d format produces percents by using parentheses for negative values.

Example

put x percentn10.;
Value of x
Result
–0.1
      -10%
.2
       20%
.8
       80%
–0.05
       -5%
–6.3
     –630%

See Also