Chapter Contents

Previous

Next
SAS Companion for UNIX Environments

Accessing SAS Data Files

If you want to read or write to a permanent SAS file, you can refer to the SAS file in one of two ways:

A libref is a nickname that you can use to refer to the data library during the SAS session or job. You will probably want to use a libref when:

You can assign a libref with the LIBNAME statement or through the New Library window in the Explorer. To open the New Library window, select

File
[arrow]
New
[arrow]
Library
You can also use an environment variable as the libref.

After you have defined a libref, you can use the libref in one of two ways to access a permanent SAS data library:

For example, these SAS statements access the data file FINAL.DATA in the library in the the directory /users/myid/mydir:
libname sales '/users/myid/mydir';
data sales.final;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.