Chapter Contents |
Previous |
Next |
SAS Companion for UNIX Environments |
Suppose that you want to read the data file
/users/myid/educ.dat
, but you want to refer to it with the INED environment variable.
You can define the variable at two times:
export INED=/users/myid/educ.dat
setenv
command:
x setenv INED /users/myid/educ.dat;
/users/myid/educ.dat
, you can use INED as a fileref to refer to the file in the INFILE
statement:
infile ined;
The same method applies if you want to write to an external file. For example, you can define OUTFILE before you invoke the SAS System:
OUTFILE=/users/myid/scores.dat export OUTFILEThen, use the environment variable name as a fileref to refer to the file:
file outfile;
Note: If a variable and a fileref have the same name but refer to different files,
the SAS System uses the fileref. For example, the %INCLUDE statement below
refers to file
/users/myid/this_one
.
filename ABC '/users/myid/this_one'; x setenv ABC /users/myid/that_one; %include ABC;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.