opens a file for input
- INFILE operand <options>;
The inputs to the INFILE statement are as follows:
You can use the INFILE statement to open an external file for
input or, if the file is already open, to make it the current
input file so that subsequent INPUT statements read from it.
- is either a predefined filename or a quoted string
containing the filename or character expression
in parentheses referring to the filepath.
- are explained below.
The options available for the INFILE statement are described below.
- specifies a variable in which the length of
a record will be stored as IML reads it in.
- specifies that the file is to be read in as a pure binary
file rather than as a file with record separator characters.
To do this, you must use the byte operand (<) on the
INPUT statement to get new records rather than using
separate input statements or the new line (/) operator.
The following options control how IML behaves when an
INPUT statement tries to read past the end of a record.
The default is STOPOVER.
- allows the INPUT statement to go to the next
record to obtain values for the variables.
- tolerates attempted reading past the end of
the record by assigning missing values to
variables read past the end of the record.
- treats going past the end of a record as an error
condition, which triggers an end-of-file condition.
Several examples of INFILE statements are given below:
filename in1 'student.dat'; /* specify filename IN1 */
infile in1; /* infile filepath */
infile 'student.dat'; /* path by quoted literal */
infile 'student.dat' missover; /* using options */
See Chapter 7, "File Access," for further information.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.