Hi all, I am performing a data extracting using proc sql, and I have ran into a problem I can't figure out. I think it may be a recursive join but am having trouble finding the solution. I am joining 12 tables with left outer joins, but the problem I am having is I need pcp info, rendering md info, and referring md info from a doctors table but they are all joined to my initital table with the same primary key, doctor number. Visually here is a boiled down version of what I have in the billing data: patient_id pcp ref_md rend_md 1 20 21 22 3 30 31 Here is what i have for the doctors table: doctor_id doctor_name doctor_phone etc.... 20 Tom 33333 21 Jane 44444 22 Mary 55555 30 Andy 66666 31 Bill 77777 What I want to have as the output is: patient_id pcp pcp_name pcp_phone ref_md ref_name ref_phone rend_md rend_name rend_phone 1 20 Tom 33333 21 Jane 44444 22 Mary 55555 I have to include this along with the 11 other left outer joins in my PROC SQL step also. Any help is greatly appreciated!
... View more