What is the appropriate stata code for merging same-sex married couples using SPLOC and RELATE?

I looked at the same-sex interrelationship page but it only tells me that SPLOC can be used to find same-sex married couples. I wanted to know if there was some sample STATA code that uses IPUMS-USA data to bring together a dataset of same-sex married couples.

You may find it easier to “merge” same-sex married couples during the data extract creation process. See this answer for more information on utilizing the Attach Characteristics option to create spouse variables.

If you prefer to merge same-sex married couples in STATA, you could create a dataset of married same-sex householders (SSMC>0 and RELATE=1) and a separate dataset of same-sex spouses (SSMC>0 and RELATE=2). You could then merge these two datasets together using SERIAL to uniquely identify same-sex couples that belong to the same household. Keep in mind that same-sex married couples can be identified using SSMC and RELATE in the 2013 ACS sample only.

Hope this helps.