/*****************************************************************/ /* Created by: Clinton Hayes (Updated by: Michelle Summerfield) */ /* */ /* Purpose of the program: */ /* This program demonstrated how to merge the partner information */ /* to the responding person file. */ /* (wave 5 data is used here as an example). */ /* ***************************************************************/ *Specify the release and the version of the data used; %let release=150; %let version=150; * Location of datasets (edit to reflect your paths);; libname hilda "X:\HILDA\Release &release.\files\SAS &version.c" access=readonly; *extract and sort the responding person file; proc sort data=hilda.rperson_e&version.c out=rperson; by xwaveid; run; * Select partner infomration wanted, in this example, hours worked,; * age and sex were selected; * rename and merge back with the main file; data partners; set rperson (keep = ehhpxid ehgage ehgsex ejbhruc rename=(ehhpxid=xwaveid ejbhruc = parthour ehgage = partage ehgsex = partsex )); where xwaveid ne ''; run; proc sort data=partners; by xwaveid; run; data rperson; merge rperson (in=a) partners ; by xwaveid; if a; run; * for all the people who have a partner, partner's age,sex and hours worked * are on the file;