🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 10-21-2019 02:15 AM
(10114 views)
Hello!
I've date 20120304 and time 09:30:00
I need to combine these two dates with is8601dt. format.
I'm using the below code.
Data new;
Set old;
NewDate=put(input(catch('T',date,time),b8601dt.),is8601dt.);
run;
While I'm running this code I got a error which shows invalid argument to input function
Could you please solve this query..
Thank you.
Regards
I've date 20120304 and time 09:30:00
I need to combine these two dates with is8601dt. format.
I'm using the below code.
Data new;
Set old;
NewDate=put(input(catch('T',date,time),b8601dt.),is8601dt.);
run;
While I'm running this code I got a error which shows invalid argument to input function
Could you please solve this query..
Thank you.
Regards
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See if this works for you
data test;
date='20120304';
time='09:30:00';
datetime=dhms(input(date, yymmdd8.), 0, 0, input(time, time8.));
format datetime is8601dt.;
run;
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Are date and time numerical values? I.e. actual date/time values or character values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Both date and time variables are in character format
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I mean character values
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See if this works for you
data test;
date='20120304';
time='09:30:00';
datetime=dhms(input(date, yymmdd8.), 0, 0, input(time, time8.));
format datetime is8601dt.;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Anytime 🙂