Date: Thu, 21 Oct 1999 09:18:51 -0700
Reply-To: "Berryhill, Tim" <TWB2@PGE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Berryhill, Tim" <TWB2@PGE.COM>
Subject: Re: merging problems.
Content-Type: text/plain
Panos, It is not clear that your problem can be solved. The note that dates
were dropped because of data entry errors concerns me. That sounds like the
dataset TAKEN will have multiple observations for some ID's (CRN's), and
some variables will change--same ID but different DIAG or TREAT depending on
the dates. Unfortunately, when you merge back to MASTER to pick up the
admission and discharge dates, you will not be sure which DIAG and TREAT
match which ADMIT and DISCHARG.
One approach is to just hope that the entries are sorted by date already:
DATA NEW;
MERGE MASTER(KEEP=CRN ADMIT DISCHARG SURNAME FORENAME GENDER M1 M2 M3)
TAKEN(IN=TAKEN KEEP=CRN TREAT DISCHARG);
BY CRN;
IF TAKEN;
RUN;
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
|