Chapter Contents |
Previous |
Next |
CATNAME |
Valid: | Anywhere |
Category: | Data Access |
See Also: | LIBNAME statement; FILENAME, CATALOG statement |
Syntax |
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. |
Options |
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. |
Details |
CATNAME
is useful because it allows you to access entries in multiple catalogs by
specifying a single catalog reference name (libref.catref
or just catref). After you create a catalog concatenation,
you can specify the catref in any context that accepts a simple (nonconcatenated)
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.
Comparisons |
Examples |
Assign libnames to the SAS data libraries that contain the catalogs that you want to concatenate:
libname mylib1 'my-data-library-1'; libname mylib2 'my-data-library-2';
Assign a catref, which can be any valid SAS name, to the list of catalogs that you want to logically concatenate:
catname allcats (mylib1.catalog1 mylib2.catalog2);
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
work.allcats.appkeys.keys
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, an application developer could be working on private copies of his/her application entries by using PRIVATE_CATALOG. If the same user wanted to see how his/her entries functioned when they were combined with the public version of the application, that user could find out by using COMBINED_CATALOGS.
See Also |
Statements:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.