Assigning Libraries |
Overview of Pre-assigning Libraries Using Engines Other Than the Metadata Engine |
Pre-assigning a library ensures that the library will always be available to and assigned by SAS server processes on a server-by-server basis when the server starts, rather than assigned by the client application or later in SAS code. Two types of pre-assignment are possible. First, you can pre-assign a library so that it will be accessed by the engine defined in the metadata. Second, you can pre-assign a library so that it will be accessed by the metadata engine. In either case, pre-assignment allows you to designate an assignment method for use by all of the applications that use the library.
Note: Pre-assigning a large number of libraries can have a negative impact on the execution time of SAS programs for all users. You should therefore be judicious in deciding whether to pre-assign a library or not.
Pre-assigning a library to an engine other than the metadata engine engine is a two-stage process:
Use SAS Management Console to flag the library as pre-assigned and to assign the library to the servers.
Edit configuration files so the assigned servers can retrieve library metadata by adding the METAAUTORESOURCES SAS system option to the server's sasv9_usermods.cfg file.
Stage 1: Flag the Library as Pre-assigned |
Assume that we are pre-assigning the Orion Gold Customers library. The library can be configured to be assigned by the server process by either selecting the Library is pre-assigned advanced option when the library is being registered or by modifying the library's properties after the fact. To pre-assign a library, perform the following steps:
From SAS Management Console, select Data Library Manager Libraries Orion Gold Customers Properties.
Select the Options tab.
Click the Advanced Options button.
Select the check box on the Pre-Assign tab.
Library is Pre-assigned Option
Click OK on the Advanced Options dialog box.
Click the Assign tab on the library properties window.
Select the servers you want to pre-assign the libraries to. Click OK when you are finished.
Stage 2: Edit Configuration Files |
In the previous stage, we set the libraries that are available to be pre-assigned, and we selected which servers can retrieve the library definitions from metadata. In this stage, we edit the sasv9_usermods.cfg file for the servers we selected and add a METAAUTORESOURCES SAS system option so that as those servers start, they read the library definitions from metadata.
Note: This stage is not needed for workspace servers, pooled workspace servers, stored process servers, SAS/SHARE servers, or OLAP servers. Those server types automatically read metadata when they start and assign the libraries.
To edit the configuration files, perform the following steps:
For each SAS/CONNECT server, edit the following file:
SAS-config-dir\Lev1\SASApp\ConnectServer\sasv9_usermods.cfg
Add the following SAS system option:
-metaautoresources "omsobj:ServerComponent?@Name='SASApp'"
For each DATA Step Batch server, edit the following file:
SAS-config-dir\Lev1\SASApp\DataStep\sasv9_usermods.cfg
Add the following SAS system option:
-metaautoresources "omsobj:ServerComponent?@Name='SASApp'"
Pre-assignment Using Information in an Autoexec File |
Pre-assigning libraries in an autoexec file is not a recommended practice because library assignments can be stored in two places, the autoexec file and metadata. Having configuration information in two places increases maintenance. An autoexec file is a text file that contains SAS statements that are executed when the server process starts. If an autoexec file is used in your environment, it is important to note that libraries assigned by an autoexec file take precedence over same-named libraries assigned by to the server in metadata. (Use the autoexec file created during installation, which is SAS-config-dir\Lev1\SASApp\appserver_autoexec_usermods.sas.) For example, if ORGOLD is registered in the metadata to be pre-assigned, and ORGOLD is also defined in an autoexec for the same server, the ORGOLD library is assigned using the LIBNAME information from the autoexec file. Simply put, the library assignment in the autoexec file always takes precedence.
Library Assignment in an Autoexec File
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.