Hi....I am trying to update AccessCampus on the Acad table with AccessCampus from table BAAECE. The records in table BAACE are unique whereas records in Acad could be many. When I run proc sql to create Acad1, it takes a long time to run. I am looking for a better and faster way to join these tables. I was going to try and use Update statement but from what I could find out is that the Update Statement will work if the join was one to one. Any suggestions.
proc sql noprint;
create table BAAECE as
select distinct
SROffer.Department,
SROffer.Course,
SROffer.Section,
SROffer.Programs,
SROffer.AccessCampus,
SROffer.TermCalendarID,
SROffer.SROfferID
from work.SROffer;
quit;
proc sql noprint;
create table Acad1 as
select distinct
Acad.ID,
coalescec(Acad.Department,BAAECE.Department) as Department,
coalescec(BAAECE.AccessCampus,Acad.AccessCampus) as AccessCampus,
coalescec(Acad.Programs,BAAECE.Programs) as Programs,
coalescec(Acad.Section,BAAECE.Section) as Section,
coalesce(Acad.SROfferID,BAAECE.SROfferID) as SROfferID,
coalesce(Acad.TermCalendarID,BAAECE.TermCalendarID) as TermCalendarID
from work.Acad left join work.BAAECE on (Acad.SROfferID = BAAECE.SROfferID and Acad.Department = BAAECE.Department and Acad.Programs = BAAECE.Programs
and Acad.TermCalendarID = BAAECE.TermCalendarID and Acad.Section = BAAECE.Section);
quit;
... View more