If we assume that means the variable with the largest value of VARNUM then...
[pre]
42 proc sql;
43 select name into :lastName separated by ' '
44 from dictionary.columns
45 where libname='SASHELP' and memname='CLASS'
46 having varnum eq max(varnum)
47 ;
NOTE: The query requires remerging summary statistics back with the original data.
48 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
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!