LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 1 Feb 2004 09:55:51 -0800
Reply-To:     David9876 <david.langton@DSL.PIPEX.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         David9876 <david.langton@DSL.PIPEX.COM>
Organization: http://groups.google.com
Subject:      Re: A do-loop question
Content-Type: text/plain; charset=ISO-8859-1

Sorry - but thats just not allowed!

There is a clear boundary between data steps and proc steps - if you need to repetatively call a procedure with differing statements, you will need a macro to code the loops. Something like this should help (not tested but something along these lines...):

%macro repeat; %let aa = x1 x2 x3 x4 x5 x6; %let bb = y1 y2 y3 y4 y5;

%do i=1 %to 5; %do j=1 %to 6; %do k=%eval(&j+1) %to 6;

proc logistic; model %scan(&bb,&i) = %scan(&aa,&j) ( %scan(&aa,&k %scan(&aa,j)*%scan(&aa,&k} ); run;

%end; %end; %end; %mend; %repeat;

jn_mao@YAHOO.COM (jn mao) wrote in message news:<20040201054258.23352.qmail@web20723.mail.yahoo.com>... > Hi, SAS-L users, > > I need use a do-loop statement for a logistic model. > > I have several dependent variables need a logistic analysis by the same independent variables. I want to use a do-loop statement to do it for saving my time , can SAS allow a do-loop inside of procedure? I tried several times, but the log always shown the syntax error. Could anyone give me some helps? Thanks a lot. > > Here is my code: > > array aa {6} x1 x2 x3 x4 x5 x6; > > array bb {5} y1 y2 y3 y4 y5; > > do i=1 to 5; > > do j=1 to 6; > > do k=j+1 to 6; > > proc logistic; > > model bb{i}=aa{j} aa{k} aa{j}*aa{k}; > > output; > > end; > > end; > > end; > > > run; > > > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free web site building tool. Try it!


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