Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Using SAS/IML Software to Generate IML Statements

Making Operands More Flexible

Suppose that you want to write a program that prompts a user for the name of a data set. Unfortunately the USE, EDIT, and CREATE commands expect the data set name as a hardcoded operand rather than an indirect one. However, you can construct and execute a function that prompts the user for the data set name for a USE statement.

   /* prompt the user to give dsname for use statement */
   start flexible;
      file log;
      put 'What data set shall I use?';
      infile cards;
      input dsname $;
     call execute('use', dsname, ';');
   finish;
   run flexible;
If you enter USER.A, the program generates and executes the line
   use user.a;

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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