Below is an interesting sample code:
* Get the first two max height values;
data _null_;
set sashelp.class end=last;
retain max1 max2;
call sortn(height, max2, max1);
if last then put "max height value: " max1 max2;
run;
SAS Senior Technical Consultant (twitter: @sasrunner)
Oakville, ON, Canada
Certified SAS Base/Advanced Programmer
Certified Data Integration Developer for SAS
Certified Platform Administrator for SAS
Certified Visual Business Analyst for SAS
SAS Certified Associate: Programming Fundamentals Using SAS Viya
SAS Certified Specialist: Intermediate Programming Using SAS Viya
* Get the first two max height values;
data _null_;
set sashelp.class end=last;
retain max1 max2;
call sortn(height, max2, max1);
if last then put "max height value: " max1 max2;
run;
No comments:
Post a Comment