Published on :
Data Access CREATION_INTERNE

SAS Library Concatenation

This code is also available in: Español Français
SAS© library concatenation consists of joining the content of two or more SAS© libraries, allowing them all to be referenced with a single libref. This facilitates access to data stored in different locations. The documentation details how to specify each library (either by its already assigned libref or by its physical path) and the rules governing concatenation, notably the search order for data sets, file creation and deletion, as well as the impact on concatenation attributes. SAS© catalogs are also concatenated.
Data Analysis

Type : CREATION_INTERNE


The provided code example is an excerpt of LIBNAME syntax and does not require external data for its structural understanding. It illustrates the declaration of librefs and the use of physical paths for concatenation. In accordance with the rules, the example is considered self-contained to demonstrate the syntax.

1 Code Block
LIBNAME
Explanation :
This example demonstrates the concatenation of three libraries under the libref 'year'. Two of the libraries ('quarter1' and 'quarter2') are referenced by their preexisting librefs, while the third is specified by its physical path ('/quarter3/sales'). All libraries are enclosed in parentheses to indicate concatenation. When accessing data via 'year', SAS will search for files in the specified order: first 'quarter1', then 'quarter2', and finally '/quarter3/sales'.
Copied!
1LIBNAME year (quarter1 quarter2 '/quarter3/sales');
2 
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Copyright © SAS Institute Inc. All Rights Reserved


Related Documentation : Data Access

Sujet / Mot-cléLien vers la ressource
DOC FedSQL en/sampleCode/FEDSQL9D66
Banner
Expert Advice
Expert
Michael
Responsable de l'infrastructure Viya.
« Concatenation is perfect for version control and auditing. You can list a "Current" library followed by a "History" library. This allows your reports to run against the most recent data while keeping the historical context immediately accessible without changing a single line of your analysis code. »