Chapter Contents |
Previous |
Next |
Doing More with SAS/ASSIST Software |
In this section, you use Combine on the Data Management menu to perform a Cartesian product match merge using the AIRLINE.SCHEDULE and AIRLINE.STAFF sample tables. If you have not created the AIRLINE sample tables, see Creating the AIRLINE Sample Tables.
The AIRLINE.STAFF table contains data on each employee, such as first name, last name, and employee number. The AIRLINE.SCHEDULE table includes information about what personnel are assigned to each flight during the first week of March, including flight number, date, and employee number. This Cartesian product matches the first name and last name of each employee to the flights to which they are assigned. The employee and the schedule information are matched using the employee number found in both tables. You create a new table, WORK.STAFSKED, that contains the merged data.
The following displays show listing reports of the AIRLINE.STAFF and AIRLINE.SCHEDULE tables before they are merged.
AIRLINE.STAFF Table
AIRLINE.SCHEDULE Table
Additional Information |
For additional information about concatenating, interleaving, merging, or match merging your data, refer to the information on the SET and MERGE statements in SAS Language Reference: Dictionary.
Instructions |
Tasks | Data Management | Combine | Match merge | Second Method |
Match Merge SAS Tables Window
STAFSKED
in the Table/View field as the
name of the output table.
By leaving the defaults of Temporary and Table, a temporary table is created in the WORK library. The WORK.STAFSKED table is deleted when you exit the SAS System. An indicator next to Temporary shows that this item is selected.
You combine the columns unique to each table when each table has columns with the same values but different names, for example, if the employee number is named EMPNUM in one table and IDNUM in the other. You combine the columns common to both tables when each table has a column with the same name and the same values, for example, if each table has a column called EMPNUM with the same employee number values.
The Match Merge by Common Columns window appears with a list of columns common to both tables, that is, having the same name and same data type. The only column common to both tables is IDNUM.
Match Merge By Common Columns Window
Select Existing Columns Window
Run | Submit |
Match Merge Output
File | Close |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.