The SAS Output Delivery System and reporting techniques

Numeric Format for negative sign

Reply
N/A
Posts: 0

Numeric Format for negative sign

Hi Friends,

I tried with Format negparen6.2 for numeric column. If the field is wide enough, NEGPARENw.d places parentheses around a number to represent a negative value. But i need to be negative sign. Please help me. Very urgent.

Thanks,
Selvi.
SAS Super FREQ
Posts: 8,743

Re: Numeric Format for negative sign

Try making your width value -smaller- in order to get the parentheses to go away and show a negative sign (with negparen format) or simply use a w.d format as shown below. For more help with formatting numbers, there is extensive documentation in the SAS on-line doc or you can always call on Tech Support for help with a user-defined PICTURE format of your own.
cynthia
[pre]
data fmtnum;
input num;
return;
datalines;
-1
-.045
4
.065
;
run;

ods listing;
proc print data=fmtnum;
title 'with negparen format -- format cannot be too big';
format num negparen5.3 ;
run;

proc print data=fmtnum;
title 'with simple w.d format';
format num 5.3 ;
run;
[/pre]
Ask a Question
Discussion stats
  • 1 reply
  • 825 views
  • 0 likes
  • 2 in conversation