BookmarkSubscribeRSS Feed
Kastchei
Pyrite | Level 9
I have a need to output numeric data in a format like COMMAw.d except with spaces instead of commas:

123456789.123456789

outputs as

123 456 789.123 456 789

Is there a built in SAS format for this? I can make it by creating a character variable using put(, commaw.d) and then using translate to change all the commas to spaces, but it would be nice to have a format already. Thanks!
2 REPLIES 2
Patrick
Opal | Level 21
proc format;
  picture pCommaN
    low -< 0 = '00 000 009.900000' (prefix='-')
    0 - high = '00 000 009.900000'
  ;
run;

options ls=120;
data _null_;
  do a= -999912.123456 to 99999999.999999 by 999912.123456 ;
    put @1 'comma15.6: ' a comma15.6 @30 'comma24.6: ' a comma17.6 @61 'pCommaN.: ' a pCommaN.;
  end;
run;


HTH
Patrick
Kastchei
Pyrite | Level 9
Thanks!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 936 views
  • 1 like
  • 2 in conversation