@kari wrote: Hello, Thank you so much for the reply! The first dataset contain most of my variables of interest and the second contains the demographic variables. The two variables that must be merged to create a unique respondent are in both data files. One represents a household and one represents each individual per household. The idea is if I merge these two I have individual participants and then I must merge the two data sets to be able to run the analyses with all my variables. Please let me know if this makes sense. I appreciate your help!
Show some examples similar to your data of the values that have to be combined. There might be issues if one of them is numeric and not character. This is not a difficult operation but some consideration as to length of variables being consistent, case of character values, John JOHN and john are not equal to computers. A relatively common approach is to concatenate two strings with another character such as _ so you can avoid some possible collisions. If you have one record with JOHN and SMITH and another with JOHNS and MITH without the _ the combined value would be the same. Basic code would look like:
NewId = catx('_',variable1,variable2);
but you should specify a length for the NewId variable before this using the longest expected length of variables 1 and 2 PLUS 1 for the underscore.
... View more