Date: Tue, 2 Sep 2003 07:14:19 -0400 Magnus Mengelbier "SAS(r) Discussion" Magnus Mengelbier Re: Simple Question Solved! To: adelina.gschwandtner@UNIVIE.AC.AT text/plain; charset=ISO-8859-1

Hello Adelina

I do like your comment "This one seems to work" ... as not fully appreciating what the code does. I propose to alternatives with code as you may be applying the missing crieteria a little to broadly.

Alternative 1 (your latest code below) Keep all rows where any of the variables d1 to d61 has a value <= -2 or value >= 2. Drop all rows if at least one of the variables d1 to d61 has a missing value.

<code alt 1> do i=1 to dim(x); if x(i)=. then delete; if x(i)<=-2 or x(i)>=2 then output; end; </code alt 1>

Alternative 2 Keep all rows where any of the variables d1 to d61 has a value <= -2 or value >= 2. Evaluate only the variables d1 to d61 if the value is not missing.

<code alt 1> /* untested code */ do i=1 to dim(x); if (not missing(x(i))) then if (x(i)<=-2 or x(i)>=2) then output; end; </code alt 1>

HTH and good luck

Magnus

On Tue, 2 Sep 2003 09:55:17 +0200, Adelina Gschwandtner <adelina.gschwandtner@UNIVIE.AC.AT> wrote:

>Good morning from Vienna! > >This one seems to work: > >data new; >set old; >array x(*) d1-d61; >do i=1 to dim(x); > if x(i)=. then delete; > if x(i)<=-2 or x(i)>=2 then output; > end; >run; > >Many thanks to everyone! >The information about the array was very useful. > >Have a nice day, >Adelina. >?º°`°º?ø,??,ø?º°`°º?ø,??,ø?º°`°º?ø,??,ø?º°`°º?ø?º°`°º?ø,??,ø > >ADELINA GSCHWANDTNER DR. > >University of Vienna >Department of Economics >BWZ, Bruennerstr.72 Tel:(00431) 4277 37480 >A-1210 Vienna Fax:(00431) 4277 37498 > >Adelina.Gschwandtner@univie.ac.at > >http://www.univie.ac.at/Wirtschaftswissenschaften/gschwand/ > >?º°`°º?ø,??,ø?º°`°º?ø,??,ø?º°`°º?ø,??,ø?º°`°º?ø?º°`°º?ø,??,ø

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