You can use the SQL Set Operators transformation in a SAS Data Integration Studio
job. This transformation generates a PROC SQL statement that combines the results of
two or more queries in various ways by using the following set operators:
-
UNION: Produces all unique rows
from both queries
-
EXCEPT: Produces rows that are
part of the first query only
-
INTERSECT: Produces rows that are
common to both query results
-
OUTER UNION: Concatenates the query
results
The operator is used
between the two queries, as shown in the following example:
select columns from table
set-operator
select columns from table;
The semicolon is placed after
the last SELECT statement only. Set operators combine columns from
two queries based on their position in the reference tables without
regard to the individual column names. Columns in the same relative
position in the two queries must have the same data types. The column
names in the first query become the column names of the output table.
Therefore, only its columns are propagated to the output table.
Perform the following
tasks: