/************************************************************************** Program: LGT Remote Macros.sas Project: Housing Discrimination Study LGT Author: Rob Pitingolo Created: 8-13-15 Description: Consolidation of rental macos into a single file. Output files: tel_testers **************************************************************************/ /* Transpose tester ids */ %macro testerid; data tel_testers_in; set tel_in; %ttyp; keep control testerid ttyp; run; proc sort data = tel_testers_in; by control ttyp; run; proc transpose data = tel_testers_in out = tel_ttrans; by control; var testerid; run; data tel_testers_pre; set tel_ttrans; ctesterid = col1; lgtesterid = col2; keep control ctesterid lgtesterid; run; proc sort data = tel_testers_pre; by control; run; data lgtype; set tel_in; keep control testtype; run; proc sort data = lgtype nodupkey; by control; run; data tel_testers; merge tel_testers_pre (in=a) lgtype; by control; if a; run; %mend testerid;