Date: Tue, 25 Nov 2008 21:08:58 +0200
Reply-To: morfar <mofa@SWIFT.SE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: morfar <mofa@SWIFT.SE>
Organization: A noiseless patient Spider
Subject: how do I run this in Proc SQL
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
is there an easy way to run this and not end up with duplicate rows, which
then have to be separately deduped?
the goal is to get all new and different items from "Data b" without losing
the data from "Data a"
data a;
input c1 $ p2 $ d3 $ e4 $;datalines;
1001 601 010108 A1
1001 501 020108 B1
1001 401 030108 C1
;;;;
run;
data b;
input c1 $ p2 $ d3 $ e4 $;datalines;
1001 601 010108 A1
1001 501 020108 B1
1001 401 030108 C1
1001 301 010108 A1
1001 201 020108 T2
1001 101 030108 XX
1001 901 030108 XX
;;;;
run;
proc sql;create table joined as select a.*,b.*
from a a full join b b
on a.c1 = b.c1
order b.p2, b.d3;
quit;
|