I've been struggling with this homework question for hours and I can't figure it out because the raw data has both * and - as delimiters as well as missing data. We are supposed to combine the raw datasets by the "set" function and maybe the "by" function using the concat or interleaving method.
I am brand new to this so I can't use a complicated method which I haven't been taught yet. I tried the missover syntax to help with the missing data and it still doesn't work. Also tried DSD and DLM with no success either. this is currently the best I've gotten and as you can see with the output it is completely wrong.
libname emplib "C:\Users\Colle\Documents\Grad School\A BINF 5210 Health Data Analytics with SAS\Employee Library";
filename F1 "C:\Users\Colle\Documents\Grad School\A BINF 5210 Health Data Analytics with SAS\Employee Library\demo8-1-1.txt";
filename F2 "C:\Users\Colle\Documents\Grad School\A BINF 5210 Health Data Analytics with SAS\Employee Library\demo9-1-1.txt";
data emplib.demo1;
infile F1 dlm='*-' missover;
input id gender $ age salary;
run;
proc sort data=emplib.demo1;
by id;
run;
proc print data=emplib.demo1;
run;
data emplib.demo2;
infile F2 dlm='*-' missover;
input id gender $ age salary;
run;
proc sort data=emplib.demo2;
by id;
run;
proc print data=emplib.demo2;
run;
data emplib.final;
set emplib.demo1 emplib.demo2;
by id;
run;
proc print data=emplib.final;
run;
I am also attaching my lecture notes so you can see what I am supposed to be working with or maybe where I am going wrong.
Attached are both sets of my raw data too.
Thank you so much!!