Date: Wed, 29 Oct 2008 07:53:11 -0700
Reply-To: alexander.konn@GMAIL.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: alexander.konn@GMAIL.COM
Organization: http://groups.google.com
Subject: Re: Keep observations if at least one var in a list have is non
Content-Type: text/plain; charset=ISO-8859-1
On Oct 29, 12:24 pm, franz_cl2...@yahoo.fr (Franz) wrote:
> Dear all,
>
> I am dealing with a data set with lots of variables. How do I express the fact that observations must be kept if any of the variable value in a specific list (for example: var1, yyw, var2, zzt, yy3, tt4) is not missing?
>
> I hope you get what I mean.
>
> Thanks & Kind regards,
> Franz
Not elegant, but working:
data test;
input id var1 - var5;
datalines;
1 . . . . .
2 . 1 . . .
3 . . . . .
4 1 1 1 1 1
5 . . . . 1
;
data test1;
set test;
array xx (*) var1 - var5;
do i = 1 to dim(xx);
if not missing(xx(i)) then do;
output;
leave;
end;
end;
drop i;
run;
Hope this helps,
Alex
|