Hello everyone
I can use %put %sysfunc(date(),monyy7); to give a date format like AUG2012,but this doen't include date
what format we can use to express date like AUG082012??
Thanks
Mike
Not sure how you want to use it, but the following achieves the desired result:
data want;
input term date9.;
x= compress(put(term,worddate12.)," ,");
cards;
14jun2012
28feb2011
;
See the "formats by category" page: http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001263753.htm
Not sure how you want to use it, but the following achieves the desired result:
data want;
input term date9.;
x= compress(put(term,worddate12.)," ,");
cards;
14jun2012
28feb2011
;
Thanks Art,
1.%put %sysfunc(compress("abc_%sysfunc(date(),worddate12.)"," ,"));
2.%put abc_%sysfunc(date(),Monname3)%sysfunc(strip(%sysfunc(date(),day)))_%sysfunc(strip(%sysfunc(date(),year)));
Why wouldn't you just use &SYSDATE9? It is there for the taking, and wouldn't that be easier to read?
If you really want to rearrange it, you could use:
%let mydate = %substr(&sysdate9,3,3)%substr(&sysdate9,1,2)%substr(&sysdate9,6,4);
%put &mydate;
Good luck.
I believe &sysdate value is the date of the SAS section opened.not the current time.if the SAS section has opened for a long time,
this value could not express the current date we need.
Thank you
Mike
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.
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.