Professional Documents
Culture Documents
Data Sets
Concatenating, Interleaving, and
Merging Data Sets
Combining Data Sets Vertically
Definition of Concatenating
BY statement ensure
data sets are merged
According to values of
BY variable i.e. YEAR
Data sets matched by observation number Data sets matched by values of YEAR
Sales
Customer_support
Note: The variable ‘HomePhone’ is not in this data set
Obs from Data
Missing
SECURITY
values
(Sorted by Project)
(Sorted by Project)
Both data sets must be sorted by same variable before concatenating
Common By-variable
C H A P T E R 18
BY statement ensure
data sets are merged
According to values of
BY variable i.e. YEAR
Data sets matched by observation number Data sets matched by values of YEAR
Important
Data Company
Data Finance
Data Employee_info
Finance
Repertory
(Both data sets are sorted by IdNumber)
Finance, company and Repertory have no variables common to all data sets
But pairs of data sets have common variables
• One-to-many merge ;
Data Prices;
merge Shoes Discount ;
by Type ;
run;
Type ;
Type ;