- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
/*******/
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
File c:\temp\func.sas
----------------
start func1(x);
..
finish;
---------------
File main.sas
-------------------------
proc iml;
%include "c:\temp\func.sas";
y = func1(x);
;quit;
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Calling @Rick_SAS
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.