Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In SAS, is there a way to sort using all variables except one?

Tags:

sorting

sas

I've researched thoroughly, but it seems that there is no way to easily do it using either PROC SQL or PROC SORT.

At the moment, I have to list all the variables except the one I don't want, which is rather tedious as my table contains 50 variables. Does anyone have any suggestions?

like image 448
Twilight Sparkle Avatar asked Feb 16 '23 09:02

Twilight Sparkle


1 Answers


proc sql;
    select name into :columns separated by ' ' from dictionary.columns 
where libname = 'LIB' and memname = 'TABLE' and name ne 'COLUMN_TO_BE_EXCLUDED';
quit;

proc sort
   data = lib.table;
    by &columns; 
run;

like image 117
dwjohnston Avatar answered Mar 06 '23 19:03

dwjohnston