Whenever we want to access more than one SAS library in a data set by using only single Libref, SAS library combination or concatenation concept comes into the picture.
Combination of SAS library is the logical combining of two or more SAS Libraries. By this, we can access several libraries with one libref.
As we are already familiar that we can combine / concatenate more than two libraries by specifying their own libref or physical location name in LIBNAME statement.
Suppose we have some libraries at physical location like:
Libname JAN “C:\Users\Uma\Desktop\blog data”;
Libname FEB “C:\Users\Uma\Desktop\blog data\Functions”;
Libname MAR “C:\Users\Uma\Desktop\blog data\Pictures”;
Libname APR “C:\Users\Uma\Desktop\Template Code”;
Combination of more than two libraries would be as following:
Libname YEAR (JAN FEB MAR APR);
Or
Libname YEAR (“Path1” “Path2” “Path3” “Path4”);
Even we can go like this as well
Libname Total (“C:\Users\Uma\Desktop\Template Code\Backup Template” FEB MAR APR);
We can use this assigned libref with another LIBNAME as well as follows
LIBNAME COMPLETE (YEAR “Path5”);
Combination of SAS library is the logical combining of two or more SAS Libraries. By this, we can access several libraries with one libref.
As we are already familiar that we can combine / concatenate more than two libraries by specifying their own libref or physical location name in LIBNAME statement.
Suppose we have some libraries at physical location like:
Libname JAN “C:\Users\Uma\Desktop\blog data”;
Libname FEB “C:\Users\Uma\Desktop\blog data\Functions”;
Libname MAR “C:\Users\Uma\Desktop\blog data\Pictures”;
Libname APR “C:\Users\Uma\Desktop\Template Code”;
Combination of more than two libraries would be as following:
Libname YEAR (JAN FEB MAR APR);
Or
Libname YEAR (“Path1” “Path2” “Path3” “Path4”);
Even we can go like this as well
Libname Total (“C:\Users\Uma\Desktop\Template Code\Backup Template” FEB MAR APR);
We can use this assigned libref with another LIBNAME as well as follows
LIBNAME COMPLETE (YEAR “Path5”);
- If we don’t enclosed the physical name in single or double quotation marks then SAS would look for a previously mentioned libref with the same name
Hi, how does it works for the same dataset that is present in all libraries JAN FEB MAR.
ReplyDeleteExample: I have a dataset named Department present in all three libraries JAN, FEB and MARCH. If we do conicatinate all three libraries then which library Department dataset will present in Conicatinated Library.