Programming Statements

Defining and Executing a Module

Modules begin with a START statement, which has the following general form:

START < name > < ( arguments ) > < GLOBAL( arguments ) > ;

Modules end with a FINISH statement, which has the following general form:

FINISH < name > ;

If no name appears in the START statement, the name of the module defaults to MAIN.

There are two ways you can execute a module: you can use either a RUN statement or a CALL statement. The only difference is the order of resolution.

The general forms of these statements are as follows:

RUN name < ( arguments ) > ;
CALL name < ( arguments ) > ;

The RUN and CALL statements must have arguments to correspond to the ones defined for the modules they invoke. A module can call other modules provided that it never recursively calls itself.

The RUN and CALL statements have orders of resolution that need to be considered only when you have given a module the same name as a built-in IML subroutine. In such cases, use the CALL statement to execute the built-in subroutine and the RUN statement to execute the user-defined module.

The RUN statement is resolved in the following order:

  1. user-defined module
  2. IML built-in function or subroutine
The CALL statement is resolved in the following order:

  1. IML built-in subroutine
  2. user-defined module

Previous Page | Next Page | Top of Page