BookmarkSubscribeRSS Feed
JBrew
Calcite | Level 5

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?

2 REPLIES 2
ballardw
Super User

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.

JBrew
Calcite | Level 5

I figured it out thank for your help

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1204 views
  • 0 likes
  • 2 in conversation