Data Manipulation [6-18]
(Sample)
(Sample)
Data Set Concatenation
Data Set concatenation is to combine data sets one on top of another.
It can be done by simply using the SET statement.
Example
It can be done by simply using the SET statement.
Example
Both of the LIST1 and LIST2 data set contain the same set of variables:
- SKU: Product ID
- PRODUCT: Name of the product
- QTY: Quantity available
- Price: Price of the product
In order to analyze the complete set of data, we must combine the two data sets.
Example
Data List;
Set List1 List2;
Run;
The LIST1 and LIST2 are now combined into a new data set called LIST.
Exercise
Locate the PRDSAL2 and PRDSAL3 data sets from the SASHelp library.
Concatenate the two data sets. Save the data set in the WORK library. How many observations are there in the combined data set?
Locate the PRDSAL2 and PRDSAL3 data sets from the SASHelp library.
Concatenate the two data sets. Save the data set in the WORK library. How many observations are there in the combined data set?
Need some help?
HINT:
Simply use the SET statement to combine the two data sets. Check the total number of observations in the Log window.
SOLUTION:
data prdsale;
set sashelp.prdsal2 sashelp.prdsal3;
run;
There are 34560 observations in the combined data set.
Fill out my online form.