Statistical programming, matrix languages, and more

Inputting a module as a parameter to another module

Reply
N/A
Posts: 1

Inputting a module as a parameter to another module

In SAS/IML, I have two modules, defined as follows:

START module1 (n); PRINT n; FINISH module1; 

and

START module2 (action, n); RUN action(n); FINISH module2; 

I want to run module2 as follows:

RUN module2(module1,5); 

SAS returns an error with this - it says that it cannot find the action module. I want it to interpret this as I would expect R to interpret this, like so:

RUN module1(n); 

Is it possible in SAS/IML, or is this a limitation of the software?

Many thanks.

SAS Super FREQ
Posts: 3,418

Re: Inputting a module as a parameter to another module

In SAS/IML Studio, you can use the ALIAS statement to achieve this.  I discuss how to do it on p. 117 of my book Statistical Programming with SAS/IML Software.

In PROC IML, use CALL EXECUTE and read the chapter "Using SAS/IML Software to Generate  SAS/IML Statements."

Ask a Question
Discussion stats
  • 1 reply
  • 230 views
  • 0 likes
  • 2 in conversation