Hi everyone,
I am currently struggling with something that I think is easy but i really couldn't figure out. I tried to explore all the possibilities in data manager but nothing worked.
I am using a dataset that contains a variable called refrencespouse (each person if has a spouse have a number). I am interested in the values of this variable and i want to use all of them in a egen command.

Meaning
egen example=anymatch(referencespouse), values(22 33 44 55 ...all observations)

I have tried to copy and paste all the observation but when I paste all this value are vertical and does not run in Stata. I have also tried to copy in Excel, transpose and then paste in Stata but all the observation are put together as a unique number.

I hope that my explanation is not too confusing, I can provide a screenshot if it is useful.

Thank everyone that has an idea,

Cereghetti Jean