Chapter Contents |
Previous |
Next |
EXIST |
Category: | SAS Table |
Syntax | |
Details | |
Examples | |
Example 1: Verifying the Existence of a SAS Table | |
Example 2: Verifying the Existence of a SAS Data View | |
Example 3: Determining if a Data Set Generation Exists | |
See Also |
Syntax |
rc=EXIST(member-name<,member-type<,generation>> ); |
1 | The library member exists. |
0 | Either member-name does not exist or member-type is invalid. |
Type: Numeric
Type: Character
'ACCESS'
'CATALOG'
'DATA'
'VIEW'
Type: Character
Type: Numeric
Details |
If member-name is not specified, EXIST verifies the existence of the member specified by the system variable _LAST_. If member-type contains an invalid value, EXIST returns the value 0.
Examples |
Call the FSEDIT function only if the SAS table specified in the variable TABLENAME exists. If the table does not exist, display a message on the message line.
if (exist(tablename)) then call fsedit(tablename); else _msg_='Table '||tablename||' does not exist.';
Verify the existence of the SAS table view TEST.MYVIEW:
rc=exist('test.myview','view');
Determine if the third generation of the data set
work.one
exists:
rc=exist('work.one','data',3);
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.