Hi,
I would like to know how to use the proc format to transform my data as follow:
12.4562 to 12.46
1.232 to 01.23
-2.5 to -02.50
I 've tried with this :
proc format;
picture show (round) low-high=09.99;
run;
but I loose the minus for negative numbers.
For your example data this works:
picture show (round)
0-high = 99.99
low - <0=099.99 (prefix='-')
;
But no guarantees for other numbers.
hi ... one idea ...
proc format;
value x
low-<0 = [z6.2]
other = [z5.2]
;
run;
data test;
input x @@;
format x x.;
datalines;
12.4562 1.232 -2.5
;
Obs x
1 12.46
2 01.23
3 -02.50
For your example data this works:
picture show (round)
0-high = 99.99
low - <0=099.99 (prefix='-')
;
But no guarantees for other numbers.
thank you very much
proc format;
picture pctpic (round) low-<0 ='009.99' (prefix='-' )
0-high='009.99'
;
run;
Use some thing like this
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.
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.