Date: Thu, 20 Sep 2001 15:01:38 -0700
Reply-To: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Subject: Re: Suggestion on loop requested
Content-Type: text/plain
For a loop, try something along the lines of
x =0.125
do y = 80 by 800 by 40;
if goododd = x then
do;
newscore = y;
y = 800;
end
x+x;
end;
For a direct approach, try something like
newscore = int(log2(goododd/0.125)+.01) * 40 + 80
Barry Schwarz
OS/390 Systems Programmer
Phone: 253-773-4221
Fax: 253-773-2099
Mail stop: 80-JE
e-mail: barry.a.schwarz@boeing.com
E-mail addresses of Boeing users changed 28 Aug 01. Please update your
address book for my address with the "reply-to" address on this message.
> ----------
> From: RAHUL CHAHAL[SMTP:rahulchahal@YAHOO.COM]
> Reply To: RAHUL CHAHAL
> Sent: Thursday, September 20, 2001 2:21 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Suggestion on loop requested
>
> I would like to write a loop such that I have
> "goododd" for newscore starting at 80 and incrementing
> by 1 ie 80 81 82 .... uptp 800.
> The base value is for goododd=1
>
> if goododd=0.125 then newscore=80;
> if goododd=0.25 then newscored=120;
> if goododd=0.5 then newscored=160;
>
> if goododd=1 then newscored=200; /* Base */
>
> if goododd=2 then newscored=240;
> if goododd=4 then newscored=280;
> if goododd=8 then newscored=320;
> if goododd=16 then newscored=360;
> if goododd=32 then newscored=400;
>
> The solution I am able to think of:
> baseodd=1;
> do i=1 to 2 by 0.05;
> if goododd=1*(1+baseodd/20) then score=score+(i);
> end;
> baseodd=2;
> do i=2 to 4 by 0.10;
> if goododd=1*(1+baseodd/20) then score=score+(i);
> end;
> and so on ...
>
> Could someone help me out since my brain seems to be
> slow today. Thanks for your help.
>
>
> __________________________________________________
> Terrorist Attacks on U.S. - How can you help?
> Donate cash, emergency relief information
> http://dailynews.yahoo.com/fc/US/Emergency_Information/
>
|