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!

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
  • 2 replies
  • 1327 views
  • 1 like
  • 2 in conversation