How do I convert 05AUG16:17:10:05 to 2016-08-05T17:10:05 ?
Thanks for your help.
data _NULL_;
format
dt datetime20.
dt2 E8601DT20.
;
dt=datetime();
dt2=dt;
put dt= dt2=;
txt=put(dt,datetime20.);
txt2=put(dt2,E8601DT20.);
put txt= txt2=;
run;
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm
I found the reply helpful, but it is difficult to read the answer in current alignment. Hence, I am wring the same answer with proper alignment.
=================================================================================
data _NULL_;
format dt datetime20. dt2 E8601DT20. ;
dt=datetime();
dt2=dt;
put dt= dt2=;
txt=put(dt,datetime20.);
txt2=put(dt2,E8601DT20.);
put txt= txt2=;
run;
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm
================================================================================
Thanking you,
Yours sincerely,
- Dr. Abhijeet Safai
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 how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.