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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.