SAS Component Language Dictionary |
Verifies that a fileref has been assigned for the current SAS
session or process
-
sysrc
-
contains the return code for the operation:
0 |
Both the fileref and the external file exist. |
< 0 |
The fileref has been assigned, but the file that it points to does not exist. |
> 0 |
The fileref has not been assigned. |
Type:
Numeric
-
fileref
-
is the fileref to be validated (up to eight
characters).
Type: Character
A negative return code indicates that the fileref exists
but that the physical file associated with the fileref does not exist. A positive,
nonzero value indicates that the fileref has not been assigned.
A fileref can be assigned to an external file by using
the FILENAME statement or the FILENAME function in SCL. Under some operating
systems, you can also use system commands to assign filerefs. See the SAS
documentation for your operating environment.
Test whether the fileref MYFILE is currently assigned
to an external file. A system error message is issued if the fileref is not
currently assigned.
if (fileref('myfile') > 0) then _msg_=sysmsg();
Test the fileref MYFILE to determine whether the fileref
is assigned and whether the file that it refers to exists:
if (fileref('myfile') ne 0) then _msg_=sysmsg();
FEXIST
FILEEXIST
FILENAME
PATHNAME
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.