BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ihsan-Mahdi
Quartz | Level 8

Hello,

I have two string variables in my set that I'm trying to combine into one datetime variable formatted DATETIEM20. I tried different codes and none of them worked. Help please!

refdisdaterefdistime
3/22/201917:26
4/25/20194:38
7/27/201918:31
7/29/201915:52
8/21/201922:24
10/3/20190:13
4/9/201910:37
12/20/201916:30
8/3/201917:45
11/25/201917:45
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

UNTESTED CODE

 

date=input(refdisdate,mmddyy8.);
time=input(refdistime,time.);
datetime_variable = dhms(date),hour(time),min(time),0);
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

UNTESTED CODE

 

date=input(refdisdate,mmddyy8.);
time=input(refdistime,time.);
datetime_variable = dhms(date),hour(time),min(time),0);
--
Paige Miller
Ihsan-Mahdi
Quartz | Level 8
Worked like a charm! Thank you 🙂

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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