SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Date conversion

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

Date conversion

Hi,

I have a dataset with date as text (2016-01-07 01:48:11.000) I want to change it to DATETIME17. format? any help?

 

Thanks

 

 


Accepted Solutions
Solution
‎07-12-2016 07:25 PM
Super User
Posts: 11,343

Re: Date conversion

In a datastep you would want to create a new variable;

data want;

   set have;

   dt = input(textdate,anydtdtm32.);

  format dt datetime17.;

run;

where textdate is the name of your current variable

View solution in original post


All Replies
Solution
‎07-12-2016 07:25 PM
Super User
Posts: 11,343

Re: Date conversion

In a datastep you would want to create a new variable;

data want;

   set have;

   dt = input(textdate,anydtdtm32.);

  format dt datetime17.;

run;

where textdate is the name of your current variable

☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 291 views
  • 0 likes
  • 2 in conversation