Date: Thu, 25 Oct 2007 09:51:29 -0700
Reply-To: ram <prsana@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: ram <prsana@GMAIL.COM>
Organization: http://groups.google.com
Subject: Macros
Content-Type: text/plain; charset="iso-8859-1"
I have the following code that is giving me issues:
%macro get_data;
data gains;
alpha = 15-param3 ;
beta = 1/(alpha*(1+alpha));
do i = 1 to 1000000;
totalgain = 1000000;
do while (totalgain > min_gain);
totalgain = exp(param1 + rannor(10)*params2*params3);
end;
output;
end;
run;
proc univariate data=simloss NOPRINT;
var totalgain;
output out=percent pctlpts=90 99 99.9 99.99 pctlpre=P_;
run;
data fake;
set percent;
call symput('cutoff90',P_90);
call symput('cutoff99',P_99);
call symput('cutoff999',P_99_9);
call symput('cutoff9999',P_99_99);
run;
proc print data=fake; run;
%mend gat_data;
data simulated;
set parameters;
select;
when (frequency >= 10 and trim(dist) = 'GAMMA')
do;
%get_data;
cutoff = &cutoff90;
end;
otherwise;
end;
run;
Is there anything wrong with invoking the %get_data macro within the
data step ? In my logs I find that this piece of code does not get
executed. Can someone tell me how I can re-write this code ?
Thanks
Ram