BookmarkSubscribeRSS Feed
MohamedS
Obsidian | Level 7
Hi,

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

thanks
2 REPLIES 2
deleted_user
Not applicable
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
MohamedS
Obsidian | Level 7
Hi Peter,

Thanks, It worked.
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1224 views
  • 0 likes
  • 2 in conversation