SQL Except Operator

From sasCommunity

Jump to: navigation, search
> From: Sigurd Hermansen
> To  : SAS-L
> Sent: Wednesday, August 22, 2007 4:23 PM


A basic SAS SQL EXCEPT set operator will filter out, say, a key and twenty attribute values that don't match the same key and same set of twenty attribute values from the prior week.

e.g.,

proc sql;
   select * from
   (select * from week)
       except
   (select * from base)
;
quit;

It will not pinpoint the difference in the two datasets. Neither will it identify a new tuple. You might consider using both PROC COMPARE and PROC SQL to do all of what you hope to do.

Personal tools