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!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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 lock in 2025 pricing—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
  • 2 replies
  • 1393 views
  • 1 like
  • 2 in conversation