FILEREF Function: Windows

Verifies that a fileref has been assigned for the current SAS session.

Category: External Files
Windows specifics: the fileref argument can specify a Windows environment variable
See: FILEREF Function in SAS Functions and CALL Routines: Reference
FILENAME Function in SAS Functions and CALL Routines: Reference

Syntax

FILEREF("fileref")

Required Argument

fileref

specifies the fileref to be validated. Under Windows, fileref can also be a Windows environment variable. If the FILEREF function is used in a DATA step, fileref or the environment variable that you specify must be enclosed in quotation marks. If the FILEREF function is used in macro syntax, then fileref must not be enclosed in quotation marks.

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.

Example

For an example of using the FILEREF function, see Obtaining Directory Information.