12-16-2016 02:41 PM
I am using proc sql to pull the variable names and labels from a datafile I have and put them into macro vars (one each for varnames and labels). The issue is that I only want to pull in the varname+label pairs for those variables that do not have year values in the labels. This is what I've tried:
proc sql noprint;
select name, label
into :varnames separated by ' ', :varlabels separated by '#'
where upcase(libname)='MYLIB' and
label not contains ('%20%');
It runs without any error messages, but it pulls in all variables even if the labels do have years in them.
Any help is much appreciated!
12-16-2016 02:53 PM