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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.