The REDIRECT statement
is available only when you execute a stored program.
For more
information about stored programs, see Stored Compiled DATA Step Programs in SAS Language Reference: Concepts.
CAUTION:
Use care
when you redirect input data sets.
The number and attributes
of variables in the input data sets that you read with the REDIRECT
statement should match the number and attributes of variables in the
input data sets in the MERGE, SET, MODIFY, or UPDATE statements of
the source code. If the variable type attributes differ, the stored
program stops processing and an appropriate error message is written
to the SAS log. If the variable length attributes differ, the length
of the variable in the source code data set determines the length
of the variable in the redirected data set. Extra variables in the
redirected data sets cause the stored program to stop processing
and an error message is written to the SAS log.
Tip
The DROP or KEEP data set
options can be added in the stored program if the input data set that
you read with the REDIRECT statement has more variables than are in
the data set used to compile the program.