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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: