LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 6 Jul 2006 08:22:11 -0700
Reply-To:     machelle <machellewilchesky@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         machelle <machellewilchesky@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: IML Macro debug help :(
Comments: To: sas-l@uga.edu
In-Reply-To:  <1152126090.099606.100250@75g2000cwc.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"

Firstly, thanks for pointing me in the IML direction. I have never encountered IML before, and certainly not IML Macro code, so you can just imagine my bewilderment here having to deal with both in tandem.

This program is obviously not my own. It belongs to a professor who makes it available for d/l on his website. What I need to do is to run my data through his algorithm and compare the results to something else that I have developed. The program contains over 1000 lines of code and begins with a %macro assignment, followed by the only mention of IML:

PROC IML worksize = 30000;

And then goes into many sets of %IF &link = 1 %THEN %DO; statements with Start ...; finish; statements (which I am guessing are IML loops).

Near the end of the program there is this chunk of code, which I believe contains the syntax problem:

%IF (%length(&CLSOUT) ^= 0) %THEN %DO; I = (1:k)`; C1 = { I NI TRQWCLS COOKDCLS GCLS &XVAR }; xvar = dfbetcls; clout2 = i||ni||trqwcls||cookdcls||gcls||xvar; create &CLSOUT from clout2 [rowname = id colname = c1] ; setout &CLSOUT; append from clout2 [rowname = id colname = c1]; %END;

C1 = {id}; C2 = {ni}; c4 = {trqwcls}; c5 = {cookdcls}; c6 = {gcls}; c7 = {dfbetcls};

* print/ 'Leverage, residuals, and influence for clusters',, id [colname = C1] ni [colname = C2 format = 6.0] trqwcls [colname = C4 format = 8.4] cookdcls [colname = C5 format = 8.4] gcls [colname = C6 format = 10.4] dfbetcls [colname = C7 format = 8.4],;

Unfortunately, I don't think I can convert the %IF %Then %Do %END to a proc IML statement in the middle of everything here. Is there a way to fix it so that your suggestion below will work?

Thanks,

Machelle shiling99@yahoo.com wrote: > I believe it is wrong in syntax, the correct syntax will be, > > proc iml; > clout2={1 2 3}; > create a from clout2 [colname= {'id1' 'c1'}] ; > append from clout2 ; > quit; > > proc print; run; > > Obs id1 c1 COL3 > > 1 1 2 3 > > HTH > > > machelle wrote: > > Hi all > > I'm need to apply a macro to a dataset I am using, and I'm struggling > > to debug it. > > The following appears in my SAS log: > > > > > > NOTE 137-205: Line generated by the invoked macro "GEE". > > > > 131 I = (1:k)`; C1 = { I NI TRQWCLS COOKDCLS GCLS &XVAR }; > > xvar = dfbetcls; clout2 = i||ni||trqwcls||cookdcls||gcls||xvar; > > > > 131 ! create &CLSOUT from clout2 [rowname = id colname = c1] ; > > setout &CLSOUT; append from clout2 [rowname = id colname > > > > ------- > > > > 22 > > ERROR 22-322: Syntax error, expecting one of the following: ], |). > > > > NOTE: Line generated by the invoked macro "GEE". > > > > 132 = c1]; > > - > > 200 > > ERROR 200-322: The symbol is not recognized and will be ignored. > > > > Any ideas will be greately appreciated, > > > > Machelle


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