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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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