Is the large dataset indexed or partitioned? If it is, then you may be able to limit the data very early in the process. Add a where clause that uses a variable that is indexed or partitioned. You can add the where clause right on the join, as in the example below. Good luck. Sheri PROC SQL; CREATE TABLE Lab_Results as select LabGroup, Prov_ID, A.Enc_ID, PATIENT_ID, A.Order_ID, Order_Date, Order_End_Date, L.Lab_Status_C, ORDER_Value, L.Result_Date, L.Result_Time, Result_In_Range_YN, L.Result_Status_C FROM ProdFil.EntityLabs A JOIN ProdFil.Order_Results (where=(Result_Date >= '01JAN2013'd) L on A.Enc_ID = L.Enc_ID where A.Order_Proc_ID = '132856' quit;
... View more