BookmarkSubscribeRSS Feed
rajeshalwayswel
Pyrite | Level 9

proc format ;
picture intfm(round)
0<-9 = '9 ' (prefix=' ')
10-99 = '99 ' (prefix=' ')
100-999= '999 ' (prefix=' ')
/*., 0= '9 ' (prefix=' ')*/
;
run;

 


data have;
input a;
format a intfm.;
cards;
1
33
556
1
run;

 

When I'm applying intfm format in have data set it correctly not formatting can someone look into it. Please Share if you have any more details on it...Thank you everyone for your response of my questions... 

 

My desired output;

 

    1

  33

556

    1

 

 

 

3 REPLIES 3
Astounding
PROC Star

The pictures you have defined are left-hand justified.  So the printed result is also left-hand justified.  That might make it appear like the format does nothing.  I think you can get what you want with:

 

proc format;

picture intfm (round)  0<-999='999';

run;

 

Note #1:  Your desired results didn't show any need for a prefix.  So I took that out.

 

Note #2:  You don't really need a format at all.  If you removed the format entirely, you would get the report that you are seeking.

 

It looks like you are playing around with this, trying to understand better how it works.  So if you want to play around with the prefix, also try expanding the width of the format to cover 9999 instead of 999.  And try a non-blank prefix so you can easily tell when it is printing and when it is not.

rajeshalwayswel
Pyrite | Level 9
While using the you mentioned format prefix with "0" it starting how to remove it...I'm using prefix=' ' also it not working still it getting prefix '0'...
Patrick
Opal | Level 21

@rajeshalwayswel

For the sample data you've posted there isn't any need for a custom picture format to get your desired result. Is your sample data representative? Or why else do you see a need for a custom picture format?

data have;
  input a;
  format a best32.;
  cards;
1
33
556
1
;
run;

Capture.JPG

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1308 views
  • 0 likes
  • 3 in conversation