BookmarkSubscribeRSS Feed
carterson2
Calcite | Level 5

I want to print out a date in mmddyy10. format.

I am new, so I am sure my question is well-you-know... obvious....

put "&&d&i"

prints out as

19088

I want it to print out like this:

06/10/2012

I am stumped. Conversions stop me dead.........

Thanks for any help

jim

4 REPLIES 4
Hima
Obsidian | Level 7

data have;
input tod mmddyy10.;
cards;
03/20/2012
01/02/2012
;
run;

proc sql;
select tod format mmddyy10. from have;
quit;

Hima
Obsidian | Level 7

data have;
input tod mmddyy10.;
format tod mmddyy10.;
informat tod mmddyy10.;
cards;
03/20/2012
01/02/2012
;
run;

proc print; run;

Reeza
Super User

If its a macro variable as in your example then use something like the following:

%let test=19088;

%put %sysfunc(putn(&test, mmddyy10.));

You can replace &test with your &&d&i instead to get what you need.

Hope that helps!

carterson2
Calcite | Level 5

this worked.

Thanks

            tt= put(&&d&i,mmddyy10.);

            put tt;

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
  • 4 replies
  • 2597 views
  • 1 like
  • 3 in conversation