Chapter Contents |
Previous |
Next |
SAS Companion for UNIX Environments |
There are two types of autocall macros, those provided by SAS Institute and those you define yourself. To use the autocall facility, you must have the system option MAUTOSOURCE set.
When the SAS System is installed, the SASAUTOS system option is defined in the configuration file to refer to the location of the default macros supplied by the Institute. 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.
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. See SASAUTOS for a complete description of the SASAUTOS system option.
You can set the SASAUTOS system option when you start the SAS System, 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
Institute. If you use the default configuration files (
config.sasv8
) simply specify your autocall library
there.
Autocall libraries are searched in the order in which you specify them.
Example |
This example shows how to set up and test a macro in an autocall library.
AUTOCALL Library Example
shows two UNIX (
cat
) commands
to display the contents of two files and a SAS command to run the AUTOCALL.SAS
program.
$ 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. |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.