|Why Use CATNAME?|
|Rules for Catalog Concatenation|
|Example 1: Assigning and Using a Catalog Concatenation|
|Example 2: Creating a Nested Catalog Concatenation|
CATNAME <libref.> catref
< (libref-1.catalog-1 <(ACCESS=READONLY)>
<...libref-n.catalog-n <(ACCESS=READONLY)>)> ;
|CATNAME <libref.> catref CLEAR | _ALL_ CLEAR;|
|CATNAME <libref.> catref LIST | _ALL_ LIST;|
|Restriction:||The libref must have been previously assigned.|
is a unique catalog reference name for a catalog or a catalog concatenation that is specified in the statement. Separate the catref from the libref with a period, as in libref.catref. Any SAS name can be used for this catref.
|Tip:||Specify a specific catref or libref.catref to disassociate it from a single concatenation. Specify _ALL_ CLEAR to disassociate all currently assigned catref or libref.catref concatenations.|
|Tip:||Specify catref or libref.catref to list the attributes of a single concatenation. Specify _ALL_ to list the attributes of all catalog concatenations in your current session.|
CATNAME is useful because it enables you to access entries in multiple catalogs by specifying a single catalog reference name (libref.catref or catref). After you create a catalog concatenation, you can specify the catref in any context that accepts a simple (non-concatenated) catref.
Note: A new catalog entry is created in the first catalog even if there is an entry with the same name in another part of the concatenation.
Note: If the first catalog in a concatenation that is opened for update does not exist, the item will be written to the next catalog that exists in the concatenation.
Note: Even if the name occurs multiple times in the concatenation, only the first occurrence is shown.
The CATNAME statement is like a LIBNAME statement for catalogs. The LIBNAME statement allows you to assign a shortcut name to a SAS library so that you can use the shortcut name to find the files and use the data they contain. CATNAME allows you to assign a short name <libref.>catref (libref is optional) to one or more catalogs so that SAS can find the catalogs and use all or some of the entries in each catalog.
You might need to access entries in several SAS catalogs. The most efficient way to access the information is to logically concatenate the catalogs. Catalog concatenation enables access to the information without actually creating a new, separate, and possibly very large catalog.
NOTE: Catalog concatenation WORK.ALLCATS has been created.
Because no libref is specified, the libref is WORK by default. When you want to access a catalog entry in either of these catalogs, use the libref WORK and the catalog reference name ALLCATS instead of the original librefs and catalog names. For example, to access a catalog entry named APPKEYS.KEYS in the catalog MYLIB1.CATALOG1, specify
After you create a concatenated catalog, you can use CATNAME to combine your concatenation with other single catalogs or other concatenated catalogs. Nested catalog concatenation is useful, because you can use a single catref to access many different catalog combinations.
libname local 'my_dir'; libname main 'public_dir'; catname private_catalog (local.my_application_code local.my_frames local.my_formats); catname combined_catalogs (private_catalog main.public_catalog);
In the above example, you could work on private copies of your application entries by using PRIVATE_CATALOG. If you want to see how your entries function when they are combined with the public version of the application, you can use COMBINED_CATALOGS.