Hi Rachel,
1) I am assuming you want to merge a household level file (such as w_hhresp) with an individual level file (such as w_indresp), you can find syntax files in different formats doing exactly that here: https://www.understandingsociety.ac.uk/documentation/mainstage/syntax (“Distributing household level information to the individual level”),
2) You said to you wanted to “compile data from different years”, did you mean waves by “years”? If this is the case, then you might want to check the syntax files showing how to merge individual files across waves (https://www.understandingsociety.ac.uk/documentation/mainstage/syntax : “Merging individual files across waves into wide format” and “Merging individual files across waves into long format“). If, however, you meant calendar years, then you would need to filter out respondents who completed the survey in a given year using the w_intdaty_dv variable (though if you wanted to get all respondents that completed the survey in a given year, you would need to merge it first anyway).
I would also advise checking our online Moodle “Introduction to Understanding Society using R,Stata, SPSS and SAS” course, available here: https://www.understandingsociety.ac.uk/help/training/online It discusses the two issues you asked about, plus many other topics related to longitudinal data management you might find interesting.
Best wishes,
Understanding Society User Support Team