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

Hi

I have following  csv data

 

sample data:

id,created_date,modified_date

1021,12/23/2014 12:12:37 AM,9/21/2015 09:56:02 AM

1024,09/12/2015  04:24:00 PM,10/21/2015 11:44:03 AM

 

I have code:

 

DATA sample;

INFILE   '/path/file' dsd dlm=',' firstobs=2 ;

ATTRIB

id     informat = $5. format=$5.;

created_date   informat=mdyampm.  format=mdyampm.

modified_date  informat=mdyampm.  format=mdyampm. ;

INPUT id $ created_date Modified_date;

;run;

 

in My out put I am getting values for date variables like  9/21/2015 09:56:02 AM. 

How Can I get dates like 9/21/2015 21:56:02  or  datestamp (24 hours format without AM, PM). What is the right format I need to use for dates.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

This is a duplicate of this post https://communities.sas.com/t5/Base-SAS-Programming/how-to-read-mdyampm-dates-09-22-2015-20-15-32-AM...

 

Please delete it and ask your question only once in a single forum.

View solution in original post

1 REPLY 1
Patrick
Opal | Level 21

This is a duplicate of this post https://communities.sas.com/t5/Base-SAS-Programming/how-to-read-mdyampm-dates-09-22-2015-20-15-32-AM...

 

Please delete it and ask your question only once in a single forum.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 682 views
  • 0 likes
  • 2 in conversation