Hi All!
I have a dataset with 100+ date vairables and each observation may have 1 to 5 or so of those dates populated (all numeric date formats). I need a way to select the max date from each observation...where the dates have no standard naming convention (all random names). Can I do this with an array- or any other suggestion? THis was my attempt...but clearly not working 🙂
data all1;
set all;
array dt (*) _numeric_;
do i= 1 to dim(dt);
date1 =max(dt(i));
end;
run;
Here is a snapshot of the data...by keep in mind there are 100+ off these dates with all different names
Thak you!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.