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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 698 views
  • 0 likes
  • 2 in conversation