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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 492 views
  • 1 like
  • 2 in conversation