Dear all, I'm writing a code by sas university edition (9.4) to come out a dataset with column i, j, X, Y. The code is as below: data work.Rand;
%macro Normal_Simulation;
call streaminit(567);
do i=1 to 50;
X=Rand("normal",0.02*j-1,1.0);
IF X>3 OR X<-3 THEN DO
Y=X;
X=0;
i=i-1;
END;
ELSE Y=0;
/*u=Rand("uniform");*/
output;
end;
%mend;
do j=0 to 99;
%Normal_Simulation;
end;
run;
PROC SQL;
CREATE TABLE work.query AS
SELECT j , i , X , Y FROM work.rand;
/*WHERE J=&j AND Y=0;*/
RUN;
QUIT; Can I use any sql expression in Where statement here to come out like only the first 10 percentile dataset of X of each j in this table? Thank you. MKW
... View more