You might want to perform
more than one operation on an ESDS in one DATA step. (For example,
perhaps you want to read some records, update other records, and add
new records in one DATA step.) Regardless of the number of different
operations, you need to specify only one pair of INFILE and FILE statements
for the entire DATA step. Specify the VSAM option in both the INFILE
and the FILE statements. Specify all other options that you might
need to process the ESDS in its INFILE statement.
In a DATA step that
combines operations, SAS determines whether you want to add new records
or update existing ESDS records based on whether an INPUT statement
is associated with the INFILE statement.
-
When you
do not have an INPUT statement associated with the INFILE statement, SAS
assumes that the data in the PUT statement is to be added as a new
record at the end of the data set.
-
When you
do have an INPUT statement associated with the INFILE statement, SAS
assumes that the data in the PUT statement is to modify the record
that you have just read,
unless you change
the RBA= variable to a different value before the PUT statement executes.
When you change the RBA= variable, whatever is in the PUT buffer is
added as a new record to the end of the data set.