Dear all.
I-m very newbie to sas and I`m getting crazy with a simple problem.
I have a variable in a dataset $25. that contains a date like 18MAR2014:11:19:42
I want to convert it in a iso8601dt format...
Using
put _datetime is8601dt.;
I get in log
put _datetime is8601dt.;
---------
48
ERROR 48-59: The format $IS8601DT was not found or could not be loaded.
Could you please help me?
SAS 9.3
Thank you
KR
Well, its a process of reading the string in as the nearest date/time format, then just apply a format:
data a;
a="18MAR2014:11:19:42";
b=input(a,datetime19.);
format b e8601dt.;
run;
Hello,
Maybe you'll find this link useful:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm
Thank you Loko,
but i cannot find any example to convert string into iso format.
Could you please provide an example to convert String in to iso8601...
I can also use date and time variables to convert into iso8601...
Thank you!
Well, its a process of reading the string in as the nearest date/time format, then just apply a format:
data a;
a="18MAR2014:11:19:42";
b=input(a,datetime19.);
format b e8601dt.;
run;
As RW9 stated - you just have to choose the appropriate format (you can find them at the link mentioned in my previous post). Ther is no format named iso860 within SAS .
thank you everybody.
it works!!
Thanks RW9 for the working example
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.