My "step1.sas" holds all my libnames & %let variables. It's supposed to be a master archive of libnames and variables to be used in other subsequent sas programs.
Because I don't want a million libnames to be assigned automatically in my sas steps 2-10, Step1.sas also has a macro sql procedure that only assigns select libnames to certain steps. For example, if my step3.sas only needs a libname called "input7", then my step1.sas has the following:
%Let STEP3_PATHS=;
proc sql;
reset noprint;
select distinct "LIBNAME " || libname
into : STEP3_PATHS separated by ";"
from DICTIONARY.LIBNAMES
where libname not in
(
'LIST OF LIBNAMES TO KEEP or CANT BE CLEARED'
, 'WORK'
, 'SASUSER'
, 'SASHELP'
, 'MAPSSAS'
, 'MAPSGFK'
, 'MAPS'
, 'INPUT7'
)
;
------------------------------------------
And in my step3.sas, I call up step1.sas & step3-specific libnames with:
%include "C:\Users\myname\Step1.sas";
&STEP3_PATHS;
------------------------------------------
I want to be able to duplicate this libname sql for %let variables. I don't want a million %let variables to be assigned when I use %include "C:\Users\myname\Step1.sas";
Instead, when I run step3.sas, I only want a few relevant %let variables to be called up from step1.sas.
Any thoughts on how to accomplish this? Any help is appreciated.