Help using Base SAS procedures

Picture Formats

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

Picture Formats

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!


Accepted Solutions
Solution
‎10-12-2012 06:58 PM
Super User
Posts: 10,507

Re: Picture Formats

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


All Replies
Solution
‎10-12-2012 06:58 PM
Super User
Posts: 10,507

Re: Picture Formats

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;

Super User
Super User
Posts: 6,502

Re: Picture Formats

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.

Contributor
Posts: 27

Re: Picture Formats

This is perfect!  It worked.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 212 views
  • 3 likes
  • 3 in conversation