| Date: | Fri, 7 Jun 2002 13:51:47 -0500 |
| Reply-To: | greg.woolridge@TAP.COM |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Greg Woolridge <greg.woolridge@TAP.COM> |
| Subject: | Re: using "first." and "last." |
|
| Content-type: | text/plain; charset=us-ascii |
|---|
You must use a BY statement. This is what tells SAS to set up the first.
and last. variables in the PDV.
Greg M. Woolridge
Manager, Study Programming
TAP Pharmaceutical Products Inc.
e-mail: greg.woolridge@tap.com
phone: 847-582-2332
fax: 847-582-2403
Dave Meyer
<dmeyer@HOAGHOSP To: SAS-L@LISTSERV.UGA.EDU
ITAL.ORG> cc:
Sent by: "SAS(r) Subject: using "first." and "last."
Discussion"
<SAS-L@LISTSERV.
UGA.EDU>
06/07/02 01:20
PM
Please respond
to Dave Meyer
Hi everyone,
I have 2 data sets that get updated on a regular basis. Set1 has
patient demographic info (with no dups). Set2 has all of the MD's and
health insurance companies that a patient has ever had (with a new line
for each new MD or Ins. change).
I want to make sure that I always return the most recent MD/Insurance
info when I merge the two sets. I have been trying to use an IF - THEN
statement with "last." to return the most recent info.
The data comes sorted by the various contract start dates (so the most
recent info is the last record for each patient). I have either written
the code poorly, or I am trying to do something that SAS thinks is
illogical.
TIA for any suggestions,
Dave
Here is the code I was trying to use after the sets are merged:
DATA work.con_2 ;
Set work.con_1 ;
If last.membnum Then Do;
Company = eInsCo;
End;
RUN;
DATA work.con_2 ;
Set work.con_2 ;
If Company = " " Then Delete;
Else Return;
RUN;
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
|