Module Library


Order of Resolution for Functions and Subroutines

The SAS/IML language resolves functions in the following order:

  1. User-defined SAS/IML modules that exist in the current environment

  2. Function in the STORAGE library, if it is open

  3. Functions in the IMLMLIB library

  4. Functions built into SAS/IML software

  5. SAS DATA step functions

Prior to SAS/IML 13.1, the order of resolution was different. The order was changed in order to make it easier for programmers to call user-defined functions.

When you call a module by using the CALL statement , the SAS/IML language resolves subroutines in the following order:

  1. Subroutines built into SAS/IML software

  2. User-defined SAS/IML modules that exist in the current environment

  3. Subroutines in the STORAGE library, if it is open

  4. Subroutines in the IMLMLIB library

  5. SAS DATA step subroutines

If you want to be sure that user-defined subroutines take precedence over built-in subroutines, use the RUN statement. When you call a module by using the RUN statement , the SAS/IML language resolves subroutines in the following order:

  1. User-defined SAS/IML modules that exist in the current environment

  2. Subroutines in the STORAGE library, if it is open

  3. Subroutines in the IMLMLIB library

  4. Subroutines that are built into SAS/IML software

  5. SAS DATA step subroutines