Chapter Contents


SAS Companion for UNIX Environments

Using Autocall Libraries

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.

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 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.


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.

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

Chapter Contents



Top of Page

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