Using a permanent SAS data set In the Data step
You can also refer to a permanent data set in the data step. The following job:
LIBNAME Library '/bios524/classlib'; Data All; Set Library.Survey1; Run;
includes the following note in the SAS log:
NOTE: The data set WORK.ALL has 3 observations and 5 variables.
This job creates the temporary data set ALL from the permanent data set Library.Survey1.
The SET statement is used to read a SAS data set into the data step.
There is a better way to do this, show you later.
SET statement (data step only)
|
The SET statement is similar to the INPUT statement; both read data and are used in Data step processing but:
Pitfall: Use the INFILE and INPUT statement to read raw data file.
Use the SET statement to read SAS data sets.
Pitfall: Use the FILENAME statement to point to the raw data file used in the INFILE statement.
Use the LIBNAME statement to point to the directory containing SAS data sets.