Chapter Contents

Previous

Next
CEXIST

CEXIST



Verifies the 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.

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


Chapter Contents

Previous

Next

Top of Page

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