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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

For your example data this works:

picture show (round)

0-high = 99.99

low - <0=099.99 (prefix='-')

;

But no guarantees for other numbers.

View solution in original post

4 REPLIES 4
MikeZdeb
Rhodochrosite | Level 12

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

ballardw
Super User

For your example data this works:

picture show (round)

0-high = 99.99

low - <0=099.99 (prefix='-')

;

But no guarantees for other numbers.

Fontaines03
Calcite | Level 5

thank you very much

sassharp
Calcite | Level 5

proc format;

picture pctpic (round) low-<0 ='009.99' (prefix='-' )

0-high='009.99'

;

run;

Use some thing like this

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 7454 views
  • 0 likes
  • 4 in conversation