| Functions and CALL Routines |
| Category: | External Files |
| See: | FILEREF Function under Windows UNIX OpenVMS z/OS |
| Syntax | |
| Argument | |
| Details | |
| Examples | |
| Example 1: Verifying That a Fileref Is Assigned | |
| Example 2: Verifying That Both a Fileref and a File Exist | |
| See Also | |
Syntax |
| FILEREF(fileref) |
is a character constant, variable, or expression that specifies the fileref to be validated.
| Range: | 1 to 8 characters |
| Details |
A negative return code indicates that the fileref exists but the physical file associated with the fileref does not exist. A positive value indicates that the fileref is not assigned. A value of zero indicates that the fileref and external file both exist.
A fileref can be assigned to an external file by using the FILENAME statement or the FILENAME function.
Operating Environment Information: Under some operating environments, filerefs can also
be assigned by using system commands. For details, see the SAS documentation
for your operating environment. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
| Examples |
This example tests 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 %sysfunc(fileref(myfile))>0 %then %put MYFILE is not assigned;
This example tests for a zero value to determine whether both the fileref and the file exist:
%if %sysfunc(fileref(myfile)) ne 0 %then %put %sysfunc(sysmsg());
| See Also |
|
| |||||||||
|
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.