BookmarkSubscribeRSS Feed
JHenkel
Calcite | Level 5

I wish to store a module defined in proc iml in file definition.sas and later load it by including the file. 

definition.sas looks like this:

proc iml;
	start f_w_submit(x,y);
		create plotting var {x y}; append; close plotting;
		submit;
		 proc sgplot data=plotting;
		 	series x=x y=y / markers;
		 run;
		endsubmit;
		call delete("plotting");
	finish f_w_submit;

	store module=_all_;
quit;

Then in another file I wish to use

 

%include "C:\definition.sas";

proc iml;

	load module=(f_w_submit);

	/* Use the function f_w_submit*/

quit;

But this does not work. I get a warning saying

WARNING: Module F_W_SUBMIT definition is left incomplete.

and the function is neither compiled nor stored. If I comment out the submit block, everything works fine. What am I doing wrong?

 

I am on SAS 9.2. with SAS/IML 9.22.

 

1 REPLY 1
Rick_SAS
SAS Super FREQ

Your program works in modern versions of SAS. It might have been an issue in 9.22, but I don't know. SAS 9.22 shipped in early 2010; 

there have been 7 releases of SAS/IML since 9.22.

 

To work around the issue, don't use the %INCLUDE statement.  Instead, use the RESET STORAGE function to point to the storage library, as discussed in the article "Storing and Loading Modules."   I don't have 9.22 to try it, but I think it will work.

 

BTW,  in SAS 9.4, the SERIES subroutine was introduced, which does what you are trying to do. For examples of SAS/IML graphics in modern releases, see the documentation examples.  If possible, I highly recommend upgrading to SAS 9.4 or later.

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1073 views
  • 1 like
  • 2 in conversation