Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Programming Statements

Nesting Modules

You can nest one module within another. You must make sure that each nested module is completely contained inside of the parent module. Each module is collected independently of the others. When you nest modules, it is a good idea to indent the statements relative to the level of nesting, as shown in the following example:

   start a;
      reset print;
      start b;
         a=a+1;
      finish b;
      run b;
   finish a;
   run a;

In this example, IML starts collecting statements for a module called A. In the middle of this module, it recognizes the start of a new module called B. It saves its current work on A and collects B until encountering the first FINISH statement. It then finishes collecting A. Thus, it behaves the same as if B were collected before A, as shown below:

   start b;
      a=a+1;
   finish;
   start a;
      reset print;
      run b;
   finish;
   run a;

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.