Previous Page | Next Page

Functions and CALL Routines under OpenVMS

FILEREF Function: OpenVMS



Verifies that a fileref has been assigned for the current SAS session.
Category: External Files
OpenVMS specifics: Valid values for fileref
See: FILEREF Function in SAS Language Reference: Dictionary

Syntax
Details
See Also

Syntax

FILEREF(fileref)

fileref

is a character constant, variable, or expression that specifies the fileref to be validated. Under OpenVMS, fileref can be an OpenVMS logical name that was assigned using the DCL DEFINE command.


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.

Under OpenVMS, you can assign SAS filerefs using either of the following commands:

  1. the DCL DEFINE command

  2. X command

You can use the DCL DEFINE command to assign a fileref before you invoke SAS. For example:

$ define myfile a.txt
$ sas;
  data;
     file myfile;
     put "HELLO";
  run;

This creates the file A.TXT.

You can use the X command to assign an OpenVMS logical name during your SAS session.

Then you can use the FILEREF function to verify that the fileref was correctly assigned. For examples of using this function, see SAS Language Reference: Dictionary.


See Also

Previous Page | Next Page | Top of Page