![]() Chapter Contents |
![]() Previous |
![]() Next |
Definition |
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 and annual are previously defined librefs:
libname annual (summer winter spring fall); libname annual ('path1' 'path2' 'path3'); libname annual ('path' winter spring fall); libname total (annual 'path');
How SAS Concatenates Library Members |
This example contains three SAS data libraries, and each data library contains two SAS data files. The LIBNAME statement concatenates LIB1, LIB2 and LIB3:
LIBNAME fruit (lib1 lib2 lib3); LIB1 LIB2 LIB3 ---- ---- ---- apples apples oranges pears oranges plums
The concatenated library FRUIT has the following members:
fruit ------ apples pears oranges plums
Note: Output will always go to the first level. For example: "data
fruit.oranges" writes to LIB1.
Note that in this example, if the file APPLES in LIB1 was a different file from the APPLES in LIB2 and an update to APPLES was specified, it will only be updated in LIB1 because that is the first occurence of the member APPLES.
For complete documentation on library concatenation, see the LIBNAME statement or function in SAS Procedures Guide.
For more information on how specific operating environments handle concatenation, see the SAS documentation for your operating environment.
Rules for Library Concatenation |
Note: A new SAS file is
created in the first library even if there is a file with the same name in
another part of the concatenation.
Note: Even if the name occurs multiple times
in the concatenation, only the first occurrence is shown.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.