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 (July 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 4 Jul 2008 03:56:04 -0700
Reply-To:     domenico <stataDat@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         domenico <stataDat@GMAIL.COM>
Organization: http://groups.google.com
Subject:      do-while and proc iml
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

The macro below is an exercise that I am doing to better understand sas / iml + macro (I am newbie, the macro perhaps it seems that it makes little sense, but is only an exercise). In particular, an element of (x_ij & m) gives me a value equal to 1 if the corresponding elements of x_ij and m are both different from 0. Then sum (x_ij & m) will be equal to 2500 after 2500 loops, but I get an error in correspondence to:

%let h = %eval (sum (x_ij & m));

Someone can give me some suggestions?

thank you

domenico

/*--------------------------------------- macro---------------------------------------------------------------- */ %macro test; %let k=1; %let h=0; proc iml; x_i=j(50,1,0); x_ij=I(50); m=j(50,50,1);

%do %while(&h<2500); x_i[&k,1]=&k+1; x_ij=x_ij + x_i*t(x_i); %let k=%eval(&k+1); %let h=%eval(sum(x_ij & m)); %end;

quit; %mend test; %test;


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