BookmarkSubscribeRSS Feed
AThomalla
Obsidian | Level 7

Hi,

 

I search for the best way to get accurate information about the modules executed within an IML session.

 

Lets assume I have the following two session:

 

proc iml;
start module1(a,b);
measure = a+b;
return measure;
finish module1;

start module2(a,b);
measure = module1(a,b) + a#b;
return measure;
finish module2;

store module=_ALL_;
quit;

proc iml;
load;
a = 10;
b = 20;

val = module2(a,b);

print val;
quit;

 

In the second session I would like to get the module (code) definition of module1 and module2, to understand how the calculated value "val" has been calculated. 

 

The real scenario is that I would load the modules from a storage library which I didnt create myself in the first session, but I want to be sure, what code has been exactly executed by executing one function.

 

In the help documemtation of IML there is the topic "Accessing the IMLMLIB Source Code" which talks about the catalog SASHELP.IML. Can I directls access this file from SAS Studio to get a list of functions and the code?

1 REPLY 1
Rick_SAS
SAS Super FREQ

> In the help documemtation of IML there is the topic "Accessing the IMLMLIB Source Code" which talks about the catalog SASHELP.IML. Can I directls access this file from SAS Studio to get a list of functions and the code?

 

No, the IMLMLIB is a collection of SAS-written modules, so it does not apply to the user-written modules in your situation.

 

When you STORE a module, it is "compiled" and stored in binary form. There is no way to recover the source code for a LOADed module.

 

If seeing the source code is important, I suggest keeping the module definition in a text file such as 'module1.sas' and 'module2.sas'. Then you can use the %INCLUDE statement to read the definitions. If you turn on the SOURCE2 system option, the source is echoed to the log.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 520 views
  • 0 likes
  • 2 in conversation