SAS Component Language Dictionary |
Verifies the existence of an external file, a directory, or a
SAS data library by its physical name
sysrc=FILEEXIST(filename);
|
-
rc
-
contains the return code for the operation:
1 |
The external file exists. |
0 |
The external file does not exist. |
Type:
Numeric
-
filename
-
is the name that identifies the external
file to the host operating system. The filename
specification varies according to the operating system.
Type: Character
FILEEXIST verifies the existence of an external file,
a directory, or a SAS data library.
Although your system utilities may recognize partial
physical filenames, you must always use fully qualified physical filenames
with FILEEXIST.
Verify the existence of an external file whose filename
the user enters in the field for the window variable FNAME. Display a message
on the message line to tell the user whether the file exists.
if (fileexist(fname)) then
_msg_='The external file '||fname||' exists.';
else
_msg_=sysmsg();
EXIST
FEXIST
FILENAME
FILEREF
PATHNAME
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.