LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 22 Nov 1999 21:20:13 -0500
Reply-To:     HERMANS1 <HERMANS1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         HERMANS1 <HERMANS1@WESTAT.COM>
Subject:      Re: multiple observation records
Comments: To: diltilia@MY-DEJA.COM
Content-Type: text/plain; charset=US-ASCII

Try this: /* View does not work with CARDS statement */ data testvw/view=testvw; input user_id session sequence pagename $; ...etc... run; proc sql; create table mtest as select distinct t1.* from testvw as t1,testvw as t2 where t1.user_id=t2.user_id and t1.session ne t2.session ; quit; Sig ____________________Reply Separator____________________ Subject: multiple observation records Author: diltilia@MY-DEJA.COM Date: 11/23/99 1:34 AM

Hi,

In the following data set, what's the best way to pull out the records that have multiple sessions (in this case, user_id 2 and 3)? I used several BY step to accomplish this, and figured that there's got to be an easier way?? Please help. Many thanks -Diltilia

data test; input user_id session sequence pagename $; cards; 1 11 29 a 1 11 34 b 1 11 45 c 1 11 50 d 2 22 13 a 2 22 16 b 2 221 55 c 2 221 67 b 2 221 80 a 2 221 90 c 3 331 12 a 3 331 15 b 3 332 1 c 3 332 3 b 3 332 5 a 3 332 9 b 3 333 4 b 3 333 5 c ;

Sent via Deja.com http://www.deja.com/ Before you buy.


Back to: Top of message | Previous page | Main SAS-L page