09-26-2017 01:36 PM
So I have a long list of variables and I only want to keep (or drop) all variables with "Jan" or "jan".
Any help is very much appreciated.
input Jan1 _1_jan Feb March_ ;
1 0 0 0
2 1 1 1
09-26-2017 01:47 PM - edited 09-26-2017 01:48 PM
proc sql; select distinct name into :names separated by ' ' from dictionary.columns where upcase(memname)='HAVE' and upcase(libname)='WORK'
and upcase(name)?'JAN'; quit; data want;
set have (drop=&names); /* OR set have (keep=&names); */