Thanks Kiran.
I appreciate your time and efforts in replying to me and reminding that datetime is the proper format to use.
My objective was to get date in the format YYYYMMDDHHmmSS.
So the last solution is not what I want.
I had to remove T from the output. So I used this. compress(put(datetime(),b8601dt.),'T');
For comparison I ran your and my solution
PROC FORMAT; picture dt other='%0Y-%0m-%0d%0H%0M%0S' (datatype=datetime); RUN; DATA createdates; current1= put(datetime(), dt.); todays_date=compress(put(datetime(),b8601dt.),'T'); RUN;
and got the result as follows
current1 = 2017-06-07215453
todays_date= 20170607215454
There could be many other ways to do ,
I am accepting your earlier post as a solution. It put the ray of light on the solution
Thanks once again.
... View more