Date: Sat, 13 Jun 1998 12:31:04 GMT
Reply-To: af <armel.francois@WANADOO.FR>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: af <armel.francois@WANADOO.FR>
Organization: lemra
Subject: Re: Merge file
First, excuse me for my english ...
It's depends what you want exactly :
1) Only keep the rank who are common to T1 and t2
In this case :
(Sort T1 By RANK ,Sort T2 By RANK )
Then use the PROC MERGE :
Merge T1 (in=t1) t2(in=t2);
By RANK;
IF T1 and t2 then do;
OUTPUT T3;
END;
In this case T3 contains All that is common de t1 and t2
2) Not verify if the RANK exists in the 2 tables
Merge T1 t2;
By RANK;
OUTPUT T3;
iN this case in T3 3 kinds of observations:
a) RANK exists in t1 but not in t2 :
ID=... ; AG = .... ; RANK = ... ; WAGE = MISSING;
b) RANK exists in t2 but not in t1 :
ID=missing ; AG =missing ; RANK = ... ; WAGE = ...;
c) RANK exists both i t1 and t2;
ID=... ; AG = .... ; RANK = ... ; WAGE = ....;