Hi,
I need to replace second and minute data. I have the following time variables:
Time1 Time2 Time3
9:30:46.000 10:30:47.099 10:30:47.000
11:09:13.000 12:09:14.021 12:09:14.000
13:20:15.000 14:19:55.648 14:19:55.000
. 15:00:22.347 15:00:22.000
. 16:06:55.235 16:06:55.000
In Time3, the hour should be the same as Time2 but the minute and second should be the same as Time1 if Time1 not equal to . (dot).
Can someone please help?
Look at the HOUR, MINUTE and SECOND functions to extract the values, and the HMS function to recombine them.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.