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 (April 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 2 Apr 2004 11:23:42 +0200
Reply-To:     "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:      Re: tricky data extraction
Comments: To: neumann <geekaxl@21CN.COM>
Content-Type: text/plain; charset="iso-8859-1"

Hi Neumann,

Something like:

DATA ......; SET ......; BY Var1; IF (NOT FIRST.Var1 EQ 2) THEN DELETE; RUN;

Regards - Jim. -- . . . . . . . . . . . . . . . .

Jim Groeneveld, MSc. Biostatistician Science Team Vitatron B.V. Meander 1051 6825 MJ Arnhem Tel: +31/0 26 376 7365 Fax: +31/0 26 376 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

My computer remains home, but I will attend SUGI 2004.

[common disclaimer]

-----Original Message----- From: neumann [mailto:geekaxl@21CN.COM] Sent: Friday, April 02, 2004 08:18 To: SAS-L@LISTSERV.UGA.EDU Subject: tricky data extraction

Obs VAR1 VAR2 1 1 1.1001113E17 2 2 20031231 3 1 1.1001113E17 4 2 20040110 5 2 20040108 6 2 20040108 7 2 20040108 8 1 1.1001113E17 9 2 20040110 10 1 1.1001113E17 11 2 20040110 12 1 1.1001113E17 13 2 20040110 14 2 20031213 15 2 20031222 16 2 20031222 17 2 20031225

hi all,

i have a dataset listed upside, what i want to do is to extract every observation pair whose VAR1 is '1' and '2', when the VAR1 equals 1, it's a ID number , and when VAR1 equals 2, it's a meaningful record which i want to use, the rest should be deleted,and when it's done, it should be like this:

Obs VAR1 VAR2 1 1 1.1001113E17 2 2 20031231 3 1 1.1001113E17 4 2 20040110 8 1 1.1001113E17 9 2 20040110 10 1 1.1001113E17 11 2 20040110 12 1 1.1001113E17 13 2 20040110

anyone knows how to get this done? i need your suggestions, Thanx in advance!


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