Hi!
Would anyone have a suggestion for which function to use to find the earliest time value from an array of variables?
I appreciate it!!
Assuming you already have your array, called x
data want;
set have;
/* array x declaration */;
do over x;
min_date = min(of min_date,x);
end;
/* or whatever date format you're working with */
format min_date mmddyy10.;
run;
Hi mate,
Try this:
data test;
inv=101; date2="02FEB1900 19:00"dt; date3="01JAN1890 11:22"DT; date4="09NOV2014 02:22"dt;
format date1-date4 datetime.;
run;
data want (drop=i);
set test;
array date{*} date:;
mindate = min(of date{*});
format mindate datetime20.;
run;
Hope this helps
Att
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.