Date: Mon, 27 Nov 2006 19:35:31 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: is there another way doing it
In-Reply-To: <c2192a610611270926y2acc958bj24b0662f0bfc6670@mail.gmail.com>
Content-Type: text/plain; format=flowed
if ( ( Parnam1c = 'BAS' ) And Upcase( Preunt1c ) = '%' And ( LABRSL1N > 6
) )
Or
( ( Parnam1c = 'EOS' ) And Upcase( Preunt1c ) = '%' And ( LABRSL1N > 10
) )
Or
( ( Parnam1c = 'HGB' ) And Upcase( Preunt1c ) ='G/L' And ( ( LABRSL1N <
100 ) Or
( LABRSL1N > 200 ) )
Or
( ( Parnam1c = 'HCT' ) And Upcase( Preunt1c ) = '1' And ( ( LABRSL1N < 0.3 )
Or
( LABRSL1N > 0.6 ) )
Or
( ( Parnam1c = 'LYM' ) And Upcase( Preunt1c ) = '%' And ( ( LABRSL1N < 10 )
Or
( LABRSL1N > 60 ) )
Or
( ( Parnam1c='MON' ) And Upcase( Preunt1c ) = '%' And ( LABRSL1N > 20 )
Then Output ;
If the conditions are not mutally exclusive then you can start bundleing
things up using 'IN' operatoe which will clean the look of the code up as
well as speeding up the code.
if ( ( Parnam1c In ( 'BAS' 'EOS' 'HGB' 'HCT' 'LYM' 'MON')
And
( Upcase( Preunt1c ) In ( '%' 'G/L' '1' ) )
And
( ( LABRSL1N > 6 ) Or ( LABRSL1N > 10 ) Or ( LABRSL1N < 100 ) Or (
LABRSL1N > 200 )
Or ( LABRSL1N < 0.3 ) Or ( LABRSL1N > 0.6 ) Or ( LABRSL1N < 10 ) Or
( LABRSL1N > 60 ) Or LABRSL1N > 20 ) )
Then Output ;
Toby Dunn
Quickly, bring me a beaker of wine, so that I may wet my mind and say
something clever.
Aristophanes
Wise people, even though all laws were abolished, would still lead the same
life.
Aristophanes
You should not decide until you have heard what both have to say.
Aristophanes
From: SAS_learner <proccontents@GMAIL.COM>
Reply-To: SAS_learner <proccontents@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: is there another way doing it
Date: Mon, 27 Nov 2006 11:26:02 -0600
Hello guys for a listing I need to do something like this for couple of
different values of Parnam1c, What I am looking is there a better way to dot
it or is this only way to do it
if parnam1c='BAS' and upcase(preunt1c)='%' and (
LABRSL1N> 6) then output;
if parnam1c='EOS' and upcase(preunt1c)='%' and (
LABRSL1N> 10) then output;
if parnam1c='HGB' and upcase(preunt1c)='G/L' and (LABRSL1N<100 or
LABRSL1N>200) then output;
if parnam1c='HCT' and upcase(preunt1c)='1' and (LABRSL1N<0.3 or
LABRSL1N>0.6) then output;
if parnam1c='LYM' and upcase(preunt1c)='%' and (LABRSL1N<10 or
LABRSL1N> 60) then output;
if parnam1c='MON' and upcase(preunt1c)='%' and (
LABRSL1N> 20) then output;
thanks
_________________________________________________________________
Share your latest news with your friends with the Windows Live Spaces
friends module.
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk