Using Directories as Autocall Libraries
To use a directory as a SAS autocall library, do the following:
1. To create library members, store the source code for each macro in a separate file in
a directory. The name of the file must be the same as the macro name. For example,
the statements defining a macro that you would call by submitting %SPLIT must be
in a file named Split.
Operating Environment Information
Autocall Library Member Names On operating systems that allow filenames with
extensions, you must name autocall macro library members with a special
extension, usually .SAS. Look at the autocall macros on your system provided
by SAS to determine whether names of files containing macros must have a
special extension at your site. On
z/OS operating systems, you must assign the
macro name as the name of the PDS member.
2. Set the SASAUTOS system option to specify the directory as an autocall library. On
most hosts, the reserved fileref SASAUTOS is assigned at invocation time to the
autocall library supplied by SAS or another one designated by your site. If you are
specifying one or more autocall libraries, remember to concatenate the autocall
library supplied by SAS with your autocall libraries so that these macros will also be
available. For more information, see your host documentation and “SASAUTOS=
System Option” on page 382.
When storing files in an autocall library, remember the following:
• SAS does not restrict the type of material that you place in an autocall library. You
should store only autocall library files in it to avoid confusion and for ease of
maintenance.
• SAS lets you include more than one macro definition, as well as open code, in an
autocall library member. You should generally keep only one macro in any autocall
library member. If you need to keep several macros in the same autocall library
member, keep related macros together.
Using SAS Catalogs as Autocall Libraries
In SAS 6.11 and later, you can use the CATALOG access method to store autocall
macros as SOURCE entries in SAS catalogs. To create an autocall library using a SAS
catalog, follow these steps:
1. Use a LIBNAME statement to assign a libref to the SAS library.
2. Use a FILENAME statement with the CATALOG argument to assign a fileref to the
catalog that contains the autocall macros. For example, the following code creates a
fileref, MyMacros, that points to a catalog named MyMacs.MyAutos:
libname mymacs 'SAS-library';
filename mymacros catalog 'mymacs.myautos';
3. Store the source code for each macro in a SOURCE entry in a SAS catalog.
(SOURCE is the entry type.) The name of the SOURCE entry must be the same as
the macro name.
4. Set the SASAUTOS system option to specify the fileref as an autocall library. For
more information, see “SASAUTOS= System Option” on page 382.
Saving Macros in an Autocall Library 117