Reputation: 138
%macro pesee(nom, imprec, poids, nb_simul);
data &nom.;
do i=1 to &nb_simul.;
PoidsR= RAND('UNIForm', &poids.*(1- &imprec.), &poids.*(1+ &imprec.));
output;
end;
run;
%mend;
%pesee(Sucre, 0.1,200,3);
Hi there,
I am launching the macro simulation, but all the time it gives the following error Line and column cannot be determined
.
Upvotes: 0
Views: 7584
Reputation: 63424
Most likely, you do not have SAS 9.4 (or perhaps even have an older version of 9.4). The additional options to the RAND distribution for UNIFORM I believe were added in SAS 9.4 TS1M5 (though I can't find evidence it was added in that specific maintenance release, and it may have been possible prior in a preproduction state, it wasn't in the 9.3 documentation and they made lots of changes to RAND in 9.4 TS1M5); prior to that no arguments were possible to UNIFORM.
You most likely have to do this:
%macro pesee(nom, imprec, poids, nb_simul);
data &nom.;
do i=1 to &nb_simul.;
PoidsBase= &poids. + (2*&imprec.)*RAND('UNIForm') - &imprec.;
output;
end;
run;
%mend;
%pesee(Sucre, 0.1,200,3);
This produces the identical results to the above when a call streaminit
line is added to get a fixed seed (which I highly recommend).
Upvotes: 1