Previous Page | Next Page

SAS Component Language Dictionary

CEXIST



Verifies the physical existence of a SAS catalog or SAS catalog entry
Category: Catalog

Syntax
Examples
Example 1: Testing Whether a Catalog Can Be Updated
Example 2: Verifying the Existence of a Catalog
See Also

Syntax

rc=CEXIST(entry< ,'U'>);

rc

contains the return code for the operation:

1

The SAS catalog or catalog entry exists.

0

The SAS catalog or catalog entry does not exist.

Type: Numeric

entry

is SAS catalog, or the name of an entry in a catalog. A one- or two-level name is assumed to be the name of a catalog. To test for the existence of an entry within a catalog, use a three- or four-level name.

Note:   The CEXIST function verifies whether the entry physically exists. Concatenated names are a logical concatenation, not a physical entity. If you specify a concatenated name for entry, CEXIST will return a 0.  [cautionend]

Type: Character

'U'

tests whether the catalog specified in entry can be opened for updating.

Type: Character


Examples


Example 1: Testing Whether a Catalog Can Be Updated

Test whether the catalog LIB.CAT1 exists and can be opened for update. If the catalog does not exist, a message is displayed on the message line.

if (cexist('lib.cat1','u')) then
   _msg_='The catalog LIB.CAT1 exists and can be
                            opened for update.';
else _msg_=sysmsg();


Example 2: Verifying the Existence of a Catalog

Verify the existence of the entry X.PROGRAM in LIB.CAT1:

if (cexist('lib.cat1.x.program')) then
   _msg_='Entry X.PROGRAM exists';
else _msg_=sysmsg();


See Also

EXIST

Previous Page | Next Page | Top of Page