That looks good, but since I don't know what is in your data sets (what variable names, and what variable types numeric or character, and what the variable values) it still might have problems. Which is why I suggested you provide a portion of data sets one and two via these instructions, and then we can all stop guessing.
A time value is already a number of seconds, so no need for all of those extra function calls.
datetime=dhms(date,0,0,time);
Never put tab characters in program files.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.