BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS09
Calcite | Level 5

Could some one please let me know how I could insert parentheses as well as the $ sign for negative values using picture formats.  I can do parentheses or the $ sign but dont know how to apply both.  I am using them in Proc Report  Any thoughts?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Does this do what you want (look in log for output):

 

proc format library=work;

picture pay low-<0 ='000,009.99)' (prefix='($')

0 -high='000,009.99' (prefix='$');

run;

data _null_;

x= -1.25; put x pay.;

x= 1.25; put x pay.;

run;

View solution in original post

3 REPLIES 3
ballardw
Super User

Does this do what you want (look in log for output):

 

proc format library=work;

picture pay low-<0 ='000,009.99)' (prefix='($')

0 -high='000,009.99' (prefix='$');

run;

data _null_;

x= -1.25; put x pay.;

x= 1.25; put x pay.;

run;

Tom
Super User Tom
Super User

You should add a space to the end of the picture for positive numbers so that the decimal place lines up with the negative numbers.

SAS09
Calcite | Level 5

This is perfect!  It worked.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 912 views
  • 3 likes
  • 3 in conversation