SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jane7476
Calcite | Level 5

Hi All,

I finally wrote a piece of macro that runs regressions for all variables and data sets in a library and produces ODS.

My problem is how can i use %include or something similar to call the macro with user specified conditions:

1. The user doesn't need to see the whole code

I beleive this can be done by saying %include 'path' (where path contains the name of the sas file which has the macro reg_adm);

But

2. I also want the user to specify some parameters like Data set names etc. which I have include in %let statements within the macro reg_adm

Struggling on the last leg of the macro

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
user24feb
Barite | Level 11

I have never tried this, but in principle it is possible to do something similar in SAS Base - but uglier 🙂 - like with the EG:

39007 - How to create a simple prompt for user input

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

You should look either at

- an Enterprise Guide project with SAS code (you can dor the %inc there) and user prompts

- a stored process with required parameters. A simple web form is all that is required to call the stored process via /SASStoredProcess on the web application server

user24feb
Barite | Level 11

If I understood you correctly; 1) include any SAS-code including macros:

Filename MyFile "C:\Users\Username\Desktop\Test.sas";

%Include MyFile;

2) If you would like to user-friendly replace %let-statements, you might be looking for prompts in the enterprise guide (if you#re using one); right-klick on the code in the EG, then "properties", then "prompts".

Jane7476
Calcite | Level 5

Hi,

Thanks for your reply. Yes you understood correctly that I have used %let statements within the code. I want the user to be able to specify the %let when they run the %include statement

My problem is that my SAS EG is a server based installation and all users don't have a server. They have SAS Base locally installed. Is there a way that I can change the prompt property in SAS base also? (similar to the right click option you have suggested in SAS EG)

Thanks

user24feb
Barite | Level 11

I have never tried this, but in principle it is possible to do something similar in SAS Base - but uglier 🙂 - like with the EG:

39007 - How to create a simple prompt for user input

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 4 replies
  • 1439 views
  • 0 likes
  • 3 in conversation