Desktop productivity for business analysts and programmers

Write today's date in character format

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

Write today's date in character format

Hi all,

I am aware of the function today() which returns today's date. UnIess format it with date9., this is impossible to read.

Once I have formatted it as date9., is there a way to make it character, so it will read "07MAY2014"?

Thanks,

Marco


Accepted Solutions
Solution
‎05-07-2014 09:26 AM
Super User
Super User
Posts: 7,675

Re: Write today's date in character format

Well, I use it in footnotes as: %sysfunc(date(),date9.)

I assume, though not tried it that: put(date(),date9.)

Would also work.

View solution in original post


All Replies
Solution
‎05-07-2014 09:26 AM
Super User
Super User
Posts: 7,675

Re: Write today's date in character format

Well, I use it in footnotes as: %sysfunc(date(),date9.)

I assume, though not tried it that: put(date(),date9.)

Would also work.

Trusted Advisor
Posts: 1,228

Re: Write today's date in character format

How about this

data have;

dt=today();

format dt date9.;

chardate=quote(put(dt,date9.));

run;

proc print;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 255 views
  • 0 likes
  • 3 in conversation