I have two string variables which I want to compare using SAS in order to establish which observations occur in both variables and which are unique to one of these variables. I’ve provided an example of the data below, where Department_Old and Department_New are the variable names. Department_Old Department_New Communications Advertising Finance Communications Health and Wellbeing Finance Transport HR Health and Wellbeing I have tried to use merge to do this, but from what I can see it can only make comparisons between observations within the same row. What I would like is to check whether an observations in one variable appear anywhere in the other variable, and have to SAS provide me with a list of those observations which are unique to one variable. I know that this is something which can be achieved in excel using the VLOOKUP function, but would ideally like to keep all of my work within SAS. Is there a particular process I could use to achieve this within SAS?
... View more