Explanation of DATA: Contains a surveyor ID and answers to various survey questions. If one of the answers to the survey is 99 or 999 or 9999 (ad infinitum), then that is a numerical representation of "No." If one of the answers to the survey is 98 or 998 or 988, 9988, 998888, etc., that is a numerical representation of "Yes." Most of the data is in integer form.
I want to replace all variables that have values which start with a '9' and end with a '9' with the word "No", and all variables that start with a '9' and end with an '8' with "Yes."
My current strategy is to transform every single variable into a string tostring _all, replace
and then iterate thorugh all string_vars
perform the following two regexes:
regexr(`value', "^[9]*[9]$","No")
regexr(`value', "^[9]*[8]$", "Yes")
Is there an easier way to do this without converting all values to strings?