In this blog, let’s learn how to work on a permanent data set. We will work on Cars data set which is a sample file in SASHELP Library. We create a copy of this data set called Cars2 in work library.
We must get into the details of each SAS statement:
Data statement – defines a new data set called cars(this is stored in work library now, lets check).
Set statement – specifies that we are reading data from cars file in SASHELP library.
Run statement – simply enables running of the program.
Let’s check the Log:
Before analyzing a data set we must look at the variables and the observations.
How to get the first and last observations?
Printing first ten observations: The Proc statement below asks SAS to print first ten observations from cars2. Obs data set option when solely mentioned, assumes observations upto ten.
Printing last ten observations : We know that cars2 data set has 428 observations(check the log). Firstobs data set options defines the first observation to be processed. Obs data set option defines the last observation to be processed.