I am trying to correct the master dataset using the Correct dataset. The correct dataset was produced after the double-entry. The second column is the Correct dataset indicates the name of the variable that needs to be corrected. The problem about the code below is the missing. Some of the entries that need to be corrected is the missing. If missing is the correct entry then the master dataset should be updated as such. However, when I transpose the Correct dataset, additional empty cells are created, which SAS can't distinguish the different between the correct missing vs missing entries resulted from the transpose. I need a code that only updates the variables listed in the Correct dataset. Thank you in advance. data master; input ID $ var1 $ var2 $; datalines; 123 Yes Red 124 No Blue 125 Yes Yellow; data correct ; input ID $ variable $ correct $; datalines; 123 var1 No 123 var2 Orange 124 var2 Red 125 var1 99; proc sort data=Correct;by ID;run; proc transpose data=correct out=cwide (drop=_name_); by ID; var correct; id variable; run; proc contents data =cwide;run ; Data Final; update master cwide; by ID; run; proc print data=final; title "Corrected";run;
... View more