I'm new to SAS EG and also new to IML. I have two similar problems that i have encountered.
1. %include does not seem to work as it did in sas base. There i would just give it the location of the sas file and it worked. How do i include a sas file in SAS EG?
2. Is there a way to import/include a module that is not defined inside the same proc iml; statement? I'd rather not define all my modules inside my "main" program.
Thanks!
Hello,
1. There is no difference between SAS base and EG regarding include statements.
Maybe your SEG is configured to run program on a remote server. So you have either
to deploy the programs you wish to include on the server or execute your programs
locally. Check the menu Tools->Connexions->Servers
I don't understand your second question.
Hello,
1. There is no difference between SAS base and EG regarding include statements.
Maybe your SEG is configured to run program on a remote server. So you have either
to deploy the programs you wish to include on the server or execute your programs
locally. Check the menu Tools->Connexions->Servers
I don't understand your second question.
1. Okay, Thanks!
2. I would like to do something like this:
this part would optimally be in another file
/*******/
proc iml;
start func1(x);
..
finish;
;quit;
/*******/
This is in the main file:
/*******/
proc iml;
y = func1(x);
;quit;
/*******/
File c:\temp\func.sas
----------------
start func1(x);
..
finish;
---------------
File main.sas
-------------------------
proc iml;
%include "c:\temp\func.sas";
y = func1(x);
;quit;
--------------------------
Calling @Rick_SAS
There are three common ways to store/load or %INCLUDE modules. You can choose whichever one appeals to you.
My favorite is to use the STORE statement to store the modules to a library, then use the LOAD statement to load them when needed. That way, the modules are parsed once and stored in compiled form. When they are loaded, they do not need to be re-parsed or re-compiled.
If you have a lot of modules, you can use the _ALL_ keyword to store and load them all, thus saving some typing.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.