Hi Community: Thanks a lot for your help. I already make big progress for my project. But I just need the last step to finish it. My goal is to use PPS survey function to select 125 data from 1000 data sets, and then, I selected the rest of 875 values and change one of variables from it. Then I merged this two part together to generate a new data set. What I want to do is to repeat this function for 100 times. I get some instruction that I can use loop function, but I don't know how to apply it to such a function. Here is the code for the first prediction, proc surveyselect data=ORD method=pps sampsize=125 out = randomsurveyPPS; size b ; run; data randomsurveyPPS; set randomsurveyPPS; keep i a b; run; proc print data = randomsurveyPPS; run; proc MEANS data = randomsurveyPPS mean std; proc print data = randomsurveyPPS ; var x ; run ; data randomsurveyPPS ; set randomsurveyPPS ; file takeout ; put i b a ; run ; */Generate the 875 dummy data; proc sql; title 'SQL Table Prepart'; create table prepart as SELECT * FROM ORD except SELECT * FROM randomsurveyPPS; quit; proc print data = prepart(obs=100); var i a b; run; data prediction; set prepart; by i; if a then a = 9999; run; proc print data = prediction; run; proc sql; title 'SQL Table COMBINED'; create table combined as select * from randomsurveyPPS outer union corr select * from prediction; quit; proc print data = combined(obs=1000); var i a b; run; Also, I got some hints to generate 125 random survey dataset by reps function. I am not sure is that can be used in loop funciton. Here is the origin dataset and my first prediction code, Thanks in advance!
... View more