Referencing an External Data File

Using a FILENAME Statement

Use the FILENAME statement to point to the location of the external file that contains the data.
Filerefs perform the same function as librefs: they temporarily point to a storage location for data. However, librefs reference SAS libraries, whereas filerefs reference external files.
Syntax, FILENAME statement:
FILENAME fileref 'filename';
  • fileref is a name that you associate with an external file. The name must be one to eight characters long, begin with a letter or underscore, and contain only letters, numbers, or underscores.
  • 'filename' is the fully qualified name or location of the file.

Defining a Fully Qualified Filename

The following FILENAME statement temporarily associates the fileref Exercise with the external file that contains the data from the exercise stress tests. The complete filename is specified as C:UsersStudent1certexercise.txt in the Windows operating environment.
filename exercise 'C:UsersStudent1certexercise.txt';

Referencing a Fully Qualified Filename

When you associate a fileref with an individual external file, you specify the fileref in subsequent SAS statements and commands.
Figure 4.1 Referencing a Fully Qualified Filename
Referencing a Fully Qualified Filename
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.223.123