Hi I have the following dataset
What I would like to do is to capture min two date time values, if missing use whichever one is available
ID | first_stop_date_time | second_stop_date_time |
1234 | 01FEB20:21:56:00 | 01FEB2020:13:15:00 |
4567 | 02FEB20:15:09:00 | 03FEB2020:05:12:00 |
8910 | 21FEB20:00:00:00 |
New dataset
ID | first_stop_date_time | second_stop_date_time | min_stop_date_time |
1234 | 01FEB20:21:56:00 | 01FEB2020:13:15:00 | 01FEB2020:13:15:00 |
4567 | 02FEB20:15:09:00 | 03FEB2020:05:12:00 | 02FEB20:15:09:00 |
8910 | 21FEB20:00:00:00 | 21FEB20:00:00:00 |
The only way I can think of is transpose and combine into one date field and then use min. Was wondering if there is another easier way
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: