Chapter Contents

Previous

Next
CATNAME

CATNAME



Defines a concatenated catalog, which contains a logical combination of the entries in two or more catalogs

Category: Catalog


Syntax
Details
Examples
Example 1: Defining a CATNAME
Example 2: Defining a CATNAME for a list-id
See Also

Syntax

rc=CATNAME(cat-name,action<,catalog-list><,list-id>);

rc
contains the return code for the operation:
0 successful
1 not successful

Type: Numeric

cat-name
is a two-level name (libref.catalog) for the concatenated catalog. The libref must already be defined.

Type: Character

action
specifies the action to take on cat-name:
'SET' sets the definition.
'CLEAR' clears the definition.
'LIST' lists the members and saves them in the SCL list referenced by list-id.

Type: Character

catalog-list
lists the two-level names (libref.catalog) of two or more SAS catalogs whose entries are logically combined in cat-name. Use at least one blank space to separate catalog names. This list can contain concatenated catalogs that were previously defined with the CATNAME function.

Type: Character

list-id
contains the identifier for the list of catalogs to be logically combined in cat-name, if action is SET and catalog-list is not specified. If action is LIST, then the list contains the following information about all of the entries:

CATNAME
The catalog name, which is a two-level name (libref.catalog) for the concatenated catalog.

Type: Character

LEVELS
The total number of levels of the defined catalog name.

Type: Numeric

(sublist1...sublistn)
Sublist number 1 to n, where n is the total number of levels.

Type: List

The sublist elements are as follows:

  • LEVEL, which is the level number. Type: Numeric

  • CATALOG, which is the catalog name. Type: Character

  • ENGINE, which is the engine name. Type: Character

  • PHYSICAL NAME OF LIBRARY, which is the physical name of the library. Type: Character

Type: Numeric or List


Details

CATNAME defines a concatenated catalog that is a logical combination of the entries in two or more SAS catalogs. When the program uses cat-name as the catalog in a catalog entry name, SAS searches for the specified entry in the catalogs specified in catalog-list or list-id. A concatenated catalog name that is defined with CATNAME can be part of catalog-list or list-id for another CATNAME function.

This feature is most useful for debugging and testing during application development. It eliminates the need to copy a whole catalog when you need to test and change a single catalog entry that contains a particular method.


Examples

Example 1: Defining a CATNAME

Create concatenated catalog S.T, which logically combines the entries in catalogs A.B and C.D. Then, create concatenated catalog E.F, which contains the logical combination of the entries in the concatenated catalog S.T as well as the entries in Q.T and X.Y. A subsequent reference in a program to S.T.TEST.SCL causes SAS to search for A.B.TEST.SCL and then for C.D.TEST.SCL. A reference to E.F.TEST.SCL causes SCL to search for A.B.TEST.SCL, then for C.D.TEST.SCL, then for Q.T.TEST.SCL, and finally for X.Y.TEST.SCL.

rc=catname ('s.t','set','a.b c.d');
rc=catname ('e.f','set','s.t q.t x.y');

Example 2: Defining a CATNAME for a list-id

Use the 'LIST' action to query the definition of E.F from Example 1.

list=makelist();
rc=catname('e.f','list',",list);
call putlist(list);

See Also

SEARCH


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.