Chapter Contents |
Previous |
Next |
SAS Companion for UNIX Environments |
Each file has an internal file descriptor assigned to it. By default, 0 is the file descriptor for standard input, 1 is the file descriptor for standard output, and 2 is the file descriptor for standard error. As other files are opened, they get other file descriptors. In the Bourne shell and in the Korn shell, you can specify that data be written to or be read from a file using the file descriptor as described in File Descriptors in the Bourne and Korn Shells.
File Descriptors in the Bourne and Korn Shells |
If you are using the Bourne shell or the Korn shell, the SAS System assigns filerefs of the following form to files that have a file descriptor (see Filerefs Assigned by the SAS System) larger than 2.
FILDESnumber
number
is a two-digit representation of the file descriptor. You can use these filerefs
in your SAS applications.
For example, if you invoke SAS with the following command,
then the operating environment opens the file
sales_data
and assigns
file descriptor 4 to it:
sas salespgm 4< sales_dataSAS assigns the fileref FILDES04 to the file and executes the application
salespgm
. When the application reads input from FILDES04, it reads the file
sales_data
. Using file descriptors as filerefs enables you to use
the same application to process data from different files without changing
the application to refer to each file. In the command that you use to invoke
the application, you simply assign the appropriate file descriptor to the
file to be processed.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.