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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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