SASHELP.VCOLUMNS table has information on the variables, including labels. You can compile a list of variables that have the 'obsolete' in the label and use it to drop them.
Make sure to put the name of the library and data set in upper case.
proc sql noprint;
select name into :drop_list separated by " "
from sashelp.vcolumn
where upcase(libname)='WORK' and upcase(memname)='HAVE' and upcase(label) like '%OBSOLETE%';;
quit;
data want;
set have;
drop &drop_list;
run;
@JP1234 wrote:
data t1;
x=1;
y=2;
z=3;
w
u
v
label x="this is obsolete xx " y="this obsolete is yy" z="this is zz";
run;
data t1 has about 500 variables. about 100have 'obsolete' in their label like x and y.
How can I drop these varibles from t1 based on labels.
Jeff