Date: Tue, 6 Apr 2004 18:54:35 -0500
Reply-To: Duck-Hye Yang <dyang@CHAPINHALL.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Duck-Hye Yang <dyang@CHAPINHALL.ORG>
Subject: What's wrong in this code---I think it is weird!
Content-Type: text/plain; charset=US-ASCII
Hi,
I am very confused now!
I originally had the following code:
data BOTHAB (keep=idseq add_f city_f state_f zip5 zip4_f);
set updte;
by idseq;
if last.idseq then output bothAB;
run;
data ONLYA (keep=idseq add_f city_f state_f zip5 zip4_f);
set onlymast;
by idseq;
if last.idseq then output onlyA;
run;
------------------------------------
I thought that I can combine the two into one like this:
data ONLYA (keep=idseq add_f city_f state_f zip5 zip4_f)
BOTHAB (keep=idseq add_f city_f state_f zip5 zip4_f);
set onlymast;
by idseq;
if last.idseq then output onlyA;
set updte;
by idseq;
if last.idseq then output bothAB;
run;
----------------------------------------------------------------
When I checked the log file, it says:
NOTE: There were 131946 observations read from the data set WORK.ONLYMAST.
NOTE: There were 131947 observations read from the data set WORK.UPDTE.
----------------------------------------------------------------
However, there should be 1254959 observations from the dataset WORK.UPDTE
Can you compare the two codes and tell me what is wrong in the second code??
Thanks,
Duckhye