I'm using the IPUMS extract of the CPS March Supplement. In their extract, the variables YEAR, SERIAL, and PERNUM together uniquely identify person records in each annual sample.

They also include a variable, SPLOC, that gives the PERNUM value of the person's spouse.

I would like to create a variable called SPEMPSTAT that gives the labor market status (EMPSTAT) of each person's spouse (if they have one). In other words, use the combination of YEAR, SERIAL, and SPLOC in the person's record as a pointer to another record's YEAR, SERIAL, and PERNUM combination.

I've seen some mention that this is possible with Mata, but I wanted to make sure there wasn't a way of doing this within Stata.