04-23-2013 02:34 PM
I have two data sets, one of which is a sub-set of the other. What I would like to do is to create a third data set that contains the records that are not common to both data sets. Does anyone know of a clean way to do this?
04-23-2013 02:43 PM
If dataset B is a subset of dataset A then
create table A_minus_B as
select * from A
select * from B;
selects rows from A which do not appear in B
04-23-2013 02:54 PM
This statement would not work because it does not give an indicator of a column to match on? Even though the records are a sub-set, the columns are slightly different between the two.
04-24-2013 07:34 AM
Using the EXCEPT Operator in PROC SQL
and Generation Data Sets to Produce a Comparison Report
04-24-2013 08:18 AM
Is it this last example from the page you cited.
(query1 except query2) union (query2 except query1)
proc sql; title 'A EXCLUSIVE UNION B'; (select * from sql.a except select * from sql.b) union (select * from sql.b except select * from sql.a);
Need further help from the community? Please ask a new question.