O'Reilly logo

SAS 9.4 Language Reference, 6th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The SAS/CONNECT client signs on to the SAS/CONNECT server named REMPC. A
server library is assigned to the client session. The value for SERVER= is the same as
the server session ID that is used in the SIGNON statement.
For more information about SAS/CONNECT, see SAS/CONNECT Users Guide.
SAS/SHARE Example:
The SAS/SHARE client uses a LIBNAME statement to access a server library via the
existing libref, Sales, which was pre-defined at the SAS/SHARE server for client access.
libname sales server=server1;
For more information about SAS/SHARE, see SAS/SHARE Users Guide.
Remote Library Access for WebDAV Servers
WebDAV (Web Distributed Authoring and Versioning) is a protocol that enhances the
HTTP protocol. It provides a standard infrastructure for collaborative authoring across
the Internet. WebDAV enables you to edit web documents, stores versions for later
retrieval, and provides a locking mechanism to prevent overwriting. SAS supports the
WebDAV protocol under the UNIX and Windows operating environments.
You use a LIBNAME statement to access WebDAV servers, as shown in the following
example:
libname davdata v9 "http://www.webserver.com/users/mydir/datadir"
webdav user="mydir" pw="12345";
When you access files on a WebDAV server, SAS pulls the file from the server to your
local disk for processing. The files are temporarily stored in the SAS Work directory,
unless you use the LOCALCACHE= option in the LIBNAME statement, which
specifies a different directory for temporary storage. When you finish updating the file,
SAS pushes the file back to the WebDAV server for storage and removes the file from
the local disk.
For more information, see “WHEREUP= Data Set Option” in SAS Data Set Options:
Reference.
Library Concatenation
Definition of Library Concatenation
Concatenation is the logical combining of two or more libraries. Concatenation enables
you to access the SAS data sets in several libraries with one libref.
You can concatenate two or more libraries by specifying their librefs or physical names
in the LIBNAME statement or function.
Physical names must be enclosed in single or double quotation marks in a LIBNAME
statement. Otherwise, SAS looks for a previously assigned libref with the same name.
In the following examples, Summer, Winter, Spring, Fall, and Annual are previously
defined librefs:
libname annual (summer winter spring fall);
libname annual ('SAS-library-1' 'SAS-library-2' 'SAS-library-3');
libname annual ('SAS-library' winter spring fall);
580 Chapter 24 SAS Libraries
libname total (annual 'SAS-library');
How SAS Concatenates Library Members
When there are members of the same name in more than one library, the first occurrence
of the member is used for input and update processes. Output always goes to the first
library.
This example contains three SAS libraries, and each library contains two SAS data files:
Lib1
Apples and Pears
Lib2
Apples and Oranges
Lib3
Oranges and Plums
The LIBNAME statement concatenates Lib1, Lib2, and Lib3:
libname fruit (lib1 lib2 lib3);
The concatenated library Fruit has the following members:
Apples
Pears
Oranges
Plums
Note: Output always goes to the first library. For example, the following statement
writes to the first library in the concatenation, Lib1:
data fruit.oranges;
Note that in this example, if the file Apples in Lib1 was different from the file Apples in
Lib2, and if an update to Apples was specified, it is updated only in Lib1 because that is
the first occurrence of the member Apples.
For complete documentation on library concatenation, see the “LIBNAME Statement” in
SAS Statements: Reference.
Operating Environment Information
For more information about how specific operating environments handle
concatenation, see the SAS documentation for your operating environment.
Rules for Library Concatenation
After you create a library concatenation, you can specify the libref in any context that
accepts a simple (nonconcatenated) libref. These rules determine how SAS files (that is,
members of SAS libraries) are located among the concatenated libraries:
If you specify any options or an engine, the options apply only to the libraries that
you specified with the physical name, not to any library that you specified with a
libref.
When a SAS file is opened for input or update, the concatenated libraries are
searched and the first occurrence of the specified file is used.
Library Concatenation 581

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required