SAS/IntrNet 9.2: Application Dispatcher |
Defines a library that the Application Server assigns
ALLOCATE LIBRARY libref <engine> 'SAS-data-library' <options>;
Note: The syntax of the ALLOCATE LIBRARY statement is identical to that of the global LIBNAME statement. The above syntax is simplified. For a complete listing of arguments and explanations, see the LIBNAME statement in SAS Language Reference: Dictionary.
SAS librefs that are listed in PROGLIBS or ADMINLIBS statements are assumed to contain catalogs that contain SAS programs that can be executed by the Application Server. The SAS programs can be SOURCE, MACRO, or SCL catalog entries.
SAS librefs that are listed in a DATALIBS statement are available to all programs that are run by the Application Server.
Note: SAS librefs that are defined outside PROC APPSRV by using LIBNAME statements are not accessible by Application Server programs and cannot be listed in a DATALIBS, PROGLIBS, or ADMINLIBS statement.
The physical name of the SAS data library is the name that is recognized by the operating environment.
You must list all data libraries that are nested in a concatenated library in DATALIBS.
Single-level nested data libraries work properly regardless of the order of the libraries in the DATALIBS statement. For example,
PROC APPSRV; ALLOC LIBRARY ONE '/path/one'; ALLOC LIBRARY TWO ('/path/two' ONE); DATALIBS ONE TWO;
works whether the order of the libraries is coded as
DATALIBS ONE TWO
or DATALIBS TWO ONE
.
Multilevel nested libraries work only if the order in the DATALIBS statement is correct. The following code does not work because library THREE is assigned before library TWO:
PROC APPSRV; ALLOC LIBRARY ONE '/path/one'; ALLOC LIBRARY TWO ('/path/two' ONE); ALLOC LIBRARY THREE ('/path/three' TWO); DATALIBS THREE TWO ONE;
Instead, use the following code:
DATALIBS ONE TWO THREE; /* or DATALIBS TWO ONE THREE; */
ALLOC statements are order dependent. PROC APPSRV performs an automatic check on library and file assignments during its startup phase. The code
PROC APPSRV; ALLOC LIBRARY TWO ('/path/two' ONE); ALLOC LIBRARY ONE '/path/one';
fails because library ONE is not defined when the library TWO assignment is tested. This happens regardless of how the libraries are listed in the DATALIBS, PROGLIBS, or ADMINLIBS statements. Remember that the syntax is identical to that of a LIBNAME statement in SAS open code.
Every library that is used must be defined as a data library. The following code does not work because library ONE is not defined as a data library:
PROC APPSRV; ALLOC LIBRARY ONE '/path/one'; ALLOC LIBRARY TWO ('/path/two' ONE); DATALIBS TWO;
Nested program libraries generally do not work as expected. For example, the following code does not work when you attempt to run a program in library TWO. This is because library ONE is not assigned in the request executive when you attempt to assign library TWO.
PROC APPSRV; ALLOC LIBRARY ONE '/path/one'; ALLOC LIBRARY TWO ('/path/two' ONE); PROGLIBS TWO ONE;
You must change library ONE to a DATALIB by using the following code:
PROC APPSRV; ALLOC LIBRARY ONE '/path/one'; ALLOC LIBRARY TWO ('/path/two' ONE); DATALIBS ONE; PROGLIBS TWO;
The same problem can occur when you use ADMINLIBS. This can cause the most confusion because it is not always obvious what can be causing the problem.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.