Macros under z/OS |
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 Language Reference: Dictionary for details about MAUTOSOURCE.)
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. See SASAUTOS= System Option: z/OS for more information.
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.
In batch mode, you could use the following JCL statements to specify an autocall library:
//MYJOB JOB account. ... // EXEC SAS,OPTIONS='MAUTOSOURCE' //SASAUTOS DD DSN=MY.MACROS,DISP=SHR
//MYJOB JOB account ... // EXEC SAS,OPTIONS='MAUTOSOURCE' //SASAUTOS DD DSN=MY.MACROS1,DISP=SHR // DD DSN=MY.MACROS2,DISP=SHR // DD DSN=default.autocall.library, // DISP=SHR
Under TSO, you can specify an autocall library either when you invoke SAS or during a SAS session.
Creating an Autocall Macro |
To create an autocall macro, do the following:
Create a partitioned data set to function as an autocall library, or use an existing autocall library.
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_
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.