Date: Sun, 17 Mar 2002 22:41:29 GMT
Reply-To: Arthur Tabachneck <atabachneck@ROGERS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <atabachneck@ROGERS.COM>
Subject: Re: DO Loops
I don't know why it doesn't accept it but, at risk of being condemed for
suggesting a "goto" solution, you could accomplish the same thing with:
proc iml;
do c = 1 to 5;
if c < 2 then goto NextOne;
do g = 1 to 2;
do n = 1 to 5;
chance = ranuni(0);
print chance;
end;
end;
NextOne: end;
Thomas Allen Schmitt <schmitta@CSD.UWM.EDU> wrote in message
news:Pine.OSF.3.96.1020317121457.26303A-100000@alpha2.csd.uwm.edu...
> I'm trying to do a loop in my program something like below. It's in PROC
> IML and gives me the error below when I add the "if c >= 2 then do g = 1
> to 2" iteration. With out the extra loop all the Matrices are recognized
> but when I add the second loop it gives me the error.
>
> Tom
>
>
>
>
> Matrix CHANCE has not been set to a value.
>
> proc iml;
> do c = 1 to 5;
> if c >= 2 then do g = 1 to 2;
> do n = 1 to 5;
> chance = ranuni(0);
> end;
> end;
> print chance;
> end;
|