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

I have a column in a sas dataset whose format and informat both are datetime26.6
I need only date and time with hh:mm:ss.
I tried reading date column using datetime26.6/anydtdte./anydtdtm. format but none works.

Does anyone have any idea how to read and convert the given column.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Milliseconds are stored as decimals, so round the value using the ROUND function. 

View solution in original post

6 REPLIES 6
TarunKumar
Pyrite | Level 9

Pls share the sample data.

nikunjgattani
Obsidian | Level 7

24APR2017:17:03:00.000000
22APR2017:15:02:39.000000
15APR2017:17:42:46.000000
10APR2017:20:05:31.000000
23APR2017:19:27:55.000000
02APR2017:19:07:03.000000
05APR2017:18:27:11.000000
18APR2017:16:13:20.000000
28APR2017:19:24:31.000000

 

I need only date and hh:mm:ss

Reeza
Super User

Milliseconds are stored as decimals, so round the value using the ROUND function. 

nikunjgattani
Obsidian | Level 7

Thanks Reeza, Using Round function is working.

Reeza
Super User

@nikunjgattani marking your own answer as the solution is not correct unless you find and post the solution to your question. 

nikunjgattani
Obsidian | Level 7
Sorry Reeza, I mistakenly marked my comment as a solution. I intended to mark your answer as a solution.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 5623 views
  • 1 like
  • 3 in conversation