I am managing a data set from surveys that are administered through a program. Sometimes, an error occurs when entering an answer or variable during the survey and something needs to be changed after the survey data has already been stored. These changes are stored in a database given the following information: Process Order (p_order): Order in which the error should be processed (This variable is created in case there are multiple errors on one survey) Survey ID (surid): ID of the survey participant Interviewer ID (icode): ID of the interviewer Interview Start time (start): Start time of the interview Interview Date (idate): Date of the interview Variable Name (name): Name of the variable that needs to be changed Old Value (o_value): Old value of the variable that needs to be changed New Value (n_value): New value of the variable that needs to be changed I need to create a SAS code that I can run which will search through the survey SAS data set and find the matching observation with the same surid, icode, start, and idate and also has the same o_value for the desired variable we want to change. Then the code should change the value from old to new. I know i could do it by hand, but I am hoping to find a way to efficiently code this up to automate it. I think it would make sense to pull one observation at a time from the data error log and apply it to the survey data. Hoping for any advice you can provide!!
... View more