Autocall Libraries

Overview of Autocall Libraries

An autocall library contains files that define SAS macros. Under z/OS, an autocall library is a partitioned data set. Each autocall macro should be a separate member in a partitioned data set. SAS supplies some autocall macros in the system autocall library. You can also define autocall macros yourself in a user autocall library. In order to use the autocall facility, the SAS option MAUTOSOURCE must be in effect. (See SAS System Options: Reference for details about MAUTOSOURCE.)

Specifying a User Autocall Library

Overview of Specifying a User Autocall Library

You can designate a physical file, or a concatenation of physical files, as your user-written autocall library in any of the following ways:
  • with the SASAUTOS= system option. You can designate one or more filerefs or data set names as your autocall library. For more information, see SASAUTOS= System Option: z/OS.
  • with the SASAUTOS parameter of the SAS CLIST (under TSO). In this case, SAS concatenates the user autocall library in front of the system autocall library, which is specified by the CLIST parameter MAUTS.
  • with the SASAUTOS= parameter of the SAS cataloged procedure.

Example: Specifying an Autocall Library in Batch Mode

In batch mode, you could use the following JCL statements to specify an autocall library:
single autocall library:
//MYJOB JOB account. ... // EXEC SAS,OPTIONS='MAUTOSOURCE' //
SASAUTOS DD DSN=MY.MACROS,DISP=SHR
concatenated autocall library:
//MYJOB JOB account ... // EXEC SAS,OPTIONS='MAUTOSOURCE' // 
SASAUTOS DD DSN=MY.MACROS1,DISP=SHR // DDDSN=MY.MACROS2,DISP=SHR // DD DSN=default.autocall.library, // DISP=SHR

Example: Specifying an Autocall Library under TSO

Under TSO, you can specify an autocall library either when you invoke SAS or during a SAS session.
When you invoke SAS:
single autocall library:
sas options('mautosource sasautos= "myid.macros"')
concatenated autocall library:
sas options('mautosource sasautos= ("myid.macros1","myid.macros2",sasautos)')
During a SAS session:
single autocall library:
options mautosource sasautos= 'myid.macros';
concatenated autocall library:
options mautosource sasautos= ('myid.macros1','myid.macros2', sasautos);

Creating an Autocall Macro

To create an autocall macro, do the following:
  1. Create a partitioned data set to function as an autocall library, or use an existing autocall library.
  2. In the autocall library, create a member that contains the source statements for the macro. The member name must be the same as the name of the macro.
Note: The SAS macro facility enables you to include the underscore character in macro names. However, z/OS does not allow the underscore character in partitioned data set member names. To create an autocall member for a macro name that contains an underscore, use a pound sign (#) in place of the underscore in the member name. For example, to create an autocall member for a macro named _SETUP_, name the member #SETUP#. However, invoke the macro by the macro name, as follows:
%_setup_