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

Could anyone help me to change to the DATE format from the character? I have added the first two observations for the character variable:

10/9/2020, 12:11 AM

10/28/2020, 1:04 PM

 

Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
dateVar = input(scan(charVar, 1, ","), mmddyy10.);
format dateVar date9.;

View solution in original post

2 REPLIES 2
Reeza
Super User
dateVar = input(scan(charVar, 1, ","), mmddyy10.);
format dateVar date9.;
Friend1
Calcite | Level 5
Thank you, Reeza for your help.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 371 views
  • 1 like
  • 2 in conversation