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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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