Date: Fri, 22 Oct 1999 21:50:47 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Shiling Zhang <shiling@MATH.WAYNE.EDU>
Organization: Wayne State University
Subject: Re: What is wrong here?
Content-Type: text/plain; charset=us-ascii
1)The big problem is evaluate j=j+0.2. In macro you need use %let
j=%sysevalf(&j+0.2); to evaluate non-interger.
2)need a & in %Classify(j, &p3, &p4); before j
3)need a & in R=j before j;
&&j would be same as &j in your context. But I guess you still have problem
work.&outp1 will resolve to work.ftPPr1.2 . My guess is that you want to use
index 'j' to indicate which output data set is associated with the R value.
So you can use %sysfunc to compress the . in dataset name.
Last take away the ';' after %bigloop if you want to.
Hope it helps.
Here is the modified one.
%DO i=1 %to 25;
%Classify(&j, &p3, &p4);
%macro Classify(j, outp1, outp2);
proc discrim data=design.ei7sel testdata=test.fostsel
kernel=normal pool=no metric=diagonal R=&j
var x7 x108 x146 x204 x269 x323 x334 x397 x398 x402 x411;
> I've been trying to execute the small programme given below, but it
> doesn't work!
> The DO-loop in the macro "Bigloop" is supposed to change the radius
> parameter (j) of a Kernel discrimination and modify the names of the two
> output files at each step accordingly.
> However, there is apparently a problem with "j=j+0.2". The new
> values of j are not transferred to the smaller macro "Classify" where the
> actual kernel discrimination is carried out with the new radius values
> (R=j) and new output data set names (outp1 and outp2).
> There might also be other problems which I haven't noticed.
> Please help me!
> Thank you very much in advance...
> Programme given below:
> %macro bigloop;
> %global rc;
> %let j=0;
> %DO i=1 %to 25;
> % j=j+0.2;
> %let p3=ftPPr&&j;
> %let p4=ftDr&&j;
> %Classify(j, &p3, &p4);
> %mend bigloop;
> %macro Classify(j, outp1, outp2);
> proc discrim data=design.ei7sel testdata=test.fostsel
> testout=work.&outp1 testoutd=work.&outp2
> kernel=normal pool=no metric=diagonal R=j
> noclassify short;
> class x1;
> var x7 x108 x146 x204 x269 x323 x334 x397 x398 x402 x411;
> %mend Classify;