Autocall Library and Stored Process Server

I've set up an autocall macro library on our SAS server (UNIX, SAS EG 4.3) by adding the following option to the config file: -SET SASAUTOS ("***macro path****")

This works just as intended, all of the macros in the "macro path" folder are available to the session. However, I'm running into problems when running stored processes which reference those same shared macros. I know the sasutos option should be in the usermods file, but I've inserted the sasautos option in all of the following files but I've still had no luck.

Store the .sas files for the user-created AUTOCALL macros in a directory other than the ones listed above, which must be concatenated into the SASAUTOS system option search path. The default SASAUTOS directory search path is determined when SAS initializes by reading the SAS configuration file(s) associated with the installation.

Multiple SAS configuration files are read by default when a stored process is executed through a workspace server or stored process server. For example, in a Windows environment the SAS configuration files read by default will be similar to this:

Re: Autocall Library and Stored Process Server

I would have thought that in a standard installation ./opt/biserver/Lev1/SASApp/sasv9_usermods.cfg will be used by all servers under SASApp.

If this is not the case then you start best with the .cfg which is called by the Stored Process Server and then look there what other .cfg are included.

If you want the autocall macro library available for all servers then adding it to ./opt/biserver/Lev1/SASApp/sasv9_usermods.cfg should be sufficient. I wouldn't define it again in all the server .cfg's as this makes maintenance more complicated and also adds the same path twice.

What exactly is not working? Are you sure that you're using the Stored Process Server under ./opt/biserver/Lev1/SASApp/StoredProcessServer?

Re: Autocall Library and Stored Process Server

Here's what is not working. When I open EG and run one of the autocall macros I don't have any problems. When I run that same macro via stored process, the macro fails (ERROR 180-322: Statement is not valid or it is used out of proper order. ) So for some reason the stored process server is not referencing the autocall library.

I first modified the ./opt/biserver/Lev1/SASApp/sasv9_usermods.cfg file and still ran into the same problem. Then I even went one step furthur and modified the

/opt/SAS/SASFoundation/9.2/nls/en/sasv9.cfg file, and I still have the same problem.

which are defined during the SAS Foundation Installation process. This file

gets recreated during SAS Installation Upgrade process therefore user

specified settings added to this file will be lost during an upgrade. With

this in mind, we strongly discourage editing this file, as the edits will

be lost on upgrade. A new configuration file named sasv9_local.cfg has

been created in the !SASROOT directory to store user specified settings.

Settings in this file will remain in place during upgrades to this SAS

Installation and will override the default options values when the same

options are contained in both places.

*/

/*

Default options:

*/

-insert sashelp !SASROOT/nls/en/sascfg

-insert helploc !SASROOT/X11/native_help

-SET SASAUTOS ("***macro path***")

--

And I checked, yes the stored process is running via SASApp - Logical Stored Process Server. I'm going to have to get with my UNIX admin and open up the config file located in ./opt/biserver/Lev1/SASApp/StoredProcessServer

Re: Autocall Library and Stored Process Server

There is an option that you can set in the metadata to specify the name of a program to run before each stored process. You can also define a program to run after the completion of each stored process. You can also define such programs at the session level.

I don't have 9.2 anymore, but here is how you do it in 9.3. And I believe it is the same in 9.2. Note that this was a new feature added in 9.2.

Login to SAS Management Console

On the Plug-Ins tab, expand Server Manager

Expand the name of your App Server (e.g., SASApp)

Right click on the appropriate logical stored process server

Go to the Options tab

Click the Set Server Properties button

Select the Request tab

Define the path for the programs to run before (and/or) after each stored process

I use this almost all the time to set autocall libraries, issue libnames based on the user, etc. All the macro vars that are available to your stored process are available to the program that is run before the stored process, as is the user id (i.e., &_metauser). So you can even do user specific things.

Note however that what you put here run before EVERY stored process. So don't overload it.

Re: Autocall Library and Stored Process Server

Since I work for multiple clients, I don't have a single standard. I try to minimize what it does and typically limit it to defining librefs, filenames, updating the fmtsearch or sasautos option.

It looks like you are trying to define macros. If so, I would use the SAS autocall facility to define the path to my macros. And I would use the insert or append options so as to make sure to not remove anything defined in the autoexec for the stored process server itself. Here is a link that talks about the insert and append options: