Date: Sun, 10 Apr 2005 22:33:52 -0700
Reply-To: Jerry <greenmt@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jerry <greenmt@GMAIL.COM>
Organization: http://groups.google.com
Subject: select observation
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I have 15 consecutive numeric variables,(q1, q2, .... q15). My
objective is to list all observations for which any of the 15 varibles
contains a numeric value "9". Below is the code I wrote, using PROC
PRINT w/ WHERE statement.
proc print data=test;
where q1=9 or q2=9 or q3=9 or q4=9 or q5=9 or q6=9 or q7=9 or q8=9 or
q9=9 or q10=9 or q11=9 or q12=9 or q13=9 or q14=9 or q15=9;
run;
My clumsy code works fine, but I wonder if there's a better way to
achieve my objective.
Thanks.
Jerry
|