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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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