BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jan_t_lagen
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
gamotte
Rhodochrosite | Level 12

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.

View solution in original post

5 REPLIES 5
gamotte
Rhodochrosite | Level 12

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.

jan_t_lagen
Calcite | Level 5

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;

/*******/

gamotte
Rhodochrosite | Level 12

 

File c:\temp\func.sas

----------------

start func1(x);

 ..

 finish;

---------------

 

File main.sas

-------------------------

proc iml;

%include "c:\temp\func.sas";

 y = func1(x);

;quit;

--------------------------

Rick_SAS
SAS Super FREQ

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1058 views
  • 1 like
  • 4 in conversation