Hey guys! I've been trying to use proc surveyselect to perform stratified random sampling and calculate the total and average of the samples taken. I'm just starting out with SAS and the Enterprise Miner. Only been at it for a week! Anyway this is the code I have come up with so far. The sampling is from a Claims data set. Here is the code I have come up with so far. For some reason the code is not generating 10000 sample iterations which is what I need. In fact, it is only generating one! I am not getting any error messages. %let nSim=10000; %let nTot=225; %let n1=100; %let n2=75; %let n3=50; %let Seed=12345; %MACRO sample; proc surveyselect data=&EM_IMPORT_DATA out=Lib.sampler sampsize=(&n1 &n2 &n3) seed=&Seed rep=1; strata Strata; %MEND sample; data Lib.Claims; keep sim Claimstot Claimsavg; array Claimsamt[&nTot]; do sim= 1 to &nSim; Claimstot=0; &sample; do i= 1 to &nTot; set Lib.sampler; Claimsamt[i] = Claim_Dollars; end; do i= 1 to &nTot; Claimstot=Claimstot + Claimsamt[i]; end; Claimsavg = Claimstot/&nTot; output; end; proc print data=Lib.Claims; run;
... View more