Date: Wed, 20 Dec 2000 11:20:17 -0600
Reply-To: JGerstle@SW.UA.EDU
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: John Gerstle <JGerstle@SW.UA.EDU>
Subject: Coding diads - simple problem
Content-type: text/plain; charset=US-ASCII
Fellow SAS-L'ers,
I've got a quick problem that has me stumped. I want to code
each pair of ptid-staffid parings uniquely. A simple numeric coding
will work. Below is my most recent attempt:
proc sort data care_baseline; by ptid staffid; run;
data care_phase2; set care_baseline;
by ptid staffid;
if first.ptid and first.staffid then diad + 1;
run;
proc print; run;
The output file has diad increasing from the
first observation on but seems to only be
counting each unique ptid and not the pairing
that I want. I also tried :
if first.ptid and last.staffid then diad + 1;
but that didn't do it either. What am I missing
here?
Thanks for any insight....John
John Gerstle
Program Analyst, Sr.
Applied Gerontology Program
University of Alabama