I'm trying to create a main SAS program that will run different SAS programs if the criteria fits.
For example
if this condition then do;
%include "sas programs\myfolder\compliance.sas" ; run;
else
%include "sas programs\myfolder\rates.sas; run;
How can I pass parameters to these programs?
What is in the program files? Is anything set up to accept parameters? What types of values need to be set as parameters?
As much as practical the best way is to place values in data sets in a library other than WORK. Reasons here are so you have the data sets in case of a crash (a very common problem when learning macro coding). Another is that values in a data set can be used with CALL Execute and may obviate the need for separate macros as call execute also builds SAS code statements.
Or do you mean that those scripts have macro definitions that you want to use? If that is the case then %include the files before use so they are available (or investigate SAS Autocall library in documentation). Then add statements to use the macros.
Details missing so pretty generic response.
I figured it out thank for your help
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.