BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lorenzom
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

View solution in original post

5 REPLIES 5
Lorenzom
Calcite | Level 5

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!

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

Loko
Barite | Level 11

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 .

Lorenzom
Calcite | Level 5

thank you everybody.

it works!!

Thanks RW9 for the working example

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 6498 views
  • 3 likes
  • 3 in conversation