Using Autocall Libraries in UNIX Environments


What is an Autocall Library?

An autocall library contains files that define SAS macros. The following sections discuss aspects of autocall libraries that are dependent on the operating environment. For more information, see SAS Macro Language: Reference .

Available Autocall Macros

There are two types of autocall macros, those provided by SAS and those you define yourself. To use the autocall facility, you must have the MAUTOSOURCE system option set.

When SAS is installed, the SASAUTOS system option is defined in the configuration file to refer to the location of the default macros supplied by SAS. The products licensed at your site determine the autocall macros you have available. You can also define your own autocall macros and store them in one or more directories.

Guidelines for Naming Macro Files

If you store autocall macros in a UNIX directory, the file extension must be .sas. Each macro file in the directory must contain a macro definition with a macro name that matches the filename. For example, a file named PrtData.sas should define a macro named PRTDATA.

The SASAUTOS System Option

To use your own autocall macros in your SAS program, specify their directories with the SASAUTOS system option. For more information, see "SASAUTOS System Option" on page 358.

Note  

The SASAUTOS system option under UNIX does not recognize filenames that are in uppercase or mixed case.

You can set the SASAUTOS system option when you start SAS, or you can use it in an OPTIONS statement during your SAS session. However, autocall libraries specified with the OPTIONS statement override any previous specification.

If you use the CONFIG system option to specify a configuration file, add your autocall library to the library concatenation supplied by SAS. If you use the default configuration files (sasv9.cfg) simply specify your autocall library there.

Autocall libraries are searched in the order in which you specify them.

Example: Setting up and Testing a Macro in an Autocall Library

This example shows how to set up and test a macro in an autocall library.

The following output shows the results of executing two UNIX ( cat ) commands to display the contents of two files and a SAS command to run the Autocall.sas program.

Output 14.2: AUTOCALL Library Example
start example
 $ cat maclib/testauto.sas %macro testauto; x echo 'Autocall library is working.'; %mend testauto; $ cat source/autocall.sas filename sysautos ('!SASROOT/sasautos' '$HOME/test/sasautos'); options mautosource sasautos=(sysautos '$HOME/macros/maclib'); %testauto $ sas source/autocall.sas Autocall library is working. 
end example
 



SAS 9.1 Companion for UNIX Environments
SAS 9.1 Companion For Unix Enivronments
ISBN: 1590472101
EAN: 2147483647
Year: 2004
Pages: 185
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net