The SAS Output Delivery System and reporting techniques

Display Numbers between paranthes in Report

Reply
Contributor
Posts: 25

Display Numbers between paranthes in Report

Hi,

do any one know how to display numbers in report between paranthes i.e. (455.0)

thanks
N/A
Posts: 0

Re: Display Numbers between paranthes in Report

there is format negparen
which puts negative numbers in parentheses. Just try[pre]
data;
valuep = 455.01 ;
value = -valuep;
put value= negparen11.2 ;
put valuep= negparen11.2 ;
run; [/pre]
My SAS log shows [pre]
value=(455.01)
valuep=455.01
NOTE: The data set WORK......[/pre]

If you are unable to make your values negative, in PROC FORMAT try the PICTURE statement to achieve what you need. There is an example in online doc at http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a002473483.htm which you can adapt it to your needs. Something like [pre]
proc format ;
picture parens (round)
low - high = '0,000,000.0)'( prefix='(' ) ;
run;
[/pre]
testing in my SAS log produces [pre]
33 %put demo= %sysfunc( max( -12345.67, 1234.5), parens );
demo= (1,234.5)
[/pre]

Good Luck


PeterC
Contributor
Posts: 25

Re: Display Numbers between paranthes in Report

Posted in reply to deleted_user
Hi Peter,

Thanks, It worked.
Ask a Question
Discussion stats
  • 2 replies
  • 143 views
  • 0 likes
  • 2 in conversation