Hi,
I am currently working on a school project and I am stuck in the step where I need to save in a permanent library my sampled data. I know how to create one using a libname, but you usually do that at the beginning, right? Is there a way to do it after sampling (because I only want to save my sampled data)? Below is my sas code for your reference.
Thanks, in advance, SAS community!
Best,
Art
Filename F1 'C:\Users\among\OneDrive\Desktop\Study1_1.txt';
data study1;
infile F1;
infile F1 dsd dlm=',';
infile F1 missover;
input Patient_ID Age State $ Length_of_Stay Total_Charge;
run;
proc print data=study1;
run;
Filename F2 'C:\Users\among\OneDrive\Desktop\Study2_2.txt';
data study2;
infile F2;
infile F2 dsd dlm=',';
infile F2 missover;
input Patient_ID Group $ Test_Score;
run;
proc print data=study2;
run;
proc sort data=study1;
by Patient_ID;
run;
proc sort data=study2;
by Patient_ID;
run;
data final;
merge study1 study2;
by Patient_ID;
run;
proc print data=final;
run;
proc surveyselect
data=final
method=srs
sampsize=1000
out=final_sample
;
run;
proc print data=final_sample;
run;
--stuck here-- <how to save my sampled data?>