DATA Step, Macro, Functions and more

datetime format

Accepted Solution Solved
Reply
Occasional Contributor Bal
Occasional Contributor
Posts: 18
Accepted Solution

datetime format

I'm reading some file which is created by SAS API. In that file I have "2015-09-28T09:54:09.0325056-05:00" for this i want to read as datetime  format. 


Accepted Solutions
Solution
‎10-27-2015 02:23 PM
Respected Advisor
Posts: 4,919

Re: datetime format

Look at the informat documentation. It documents how this works

 

data test;
x = "2015-09-28T09:54:09.0325056-05:00";
y = input(x, B8601DZ35.);
format y datetime26.;
put _all_ ;
run;
PG

View solution in original post


All Replies
Super User
Posts: 19,770

Re: datetime format

Have you tried the anydtdtm. format?
Solution
‎10-27-2015 02:23 PM
Respected Advisor
Posts: 4,919

Re: datetime format

Look at the informat documentation. It documents how this works

 

data test;
x = "2015-09-28T09:54:09.0325056-05:00";
y = input(x, B8601DZ35.);
format y datetime26.;
put _all_ ;
run;
PG
Occasional Contributor Bal
Occasional Contributor
Posts: 18

Re: datetime format

Thank you very Much PG. It helps me.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 225 views
  • 1 like
  • 3 in conversation