Hi,
I have below query which is taking lot of time
proc sql; create table agent1 as select a.*, B.DEAL_BRANCH_CITY, B.DEAL_BRANCH_KEY, B.DEAL_BRANCH_NAME, B.DEAL_BRANCH_STATE, B.DEAL_PRIMARY_SUBVERTICAL_KEY, B.DEAL_PRIMARY_VERTICAL_KEY, B.DEAL_PRI_SSUB_VERTICAL_DESC, B.DEAL_PRI_VVERTICAL_DESC, B.DEAL_RM_CODE, B.DEAL_RM_NAME, B.DEAL_SEC_RM_CODE, B.DEAL_SEC_RM_NAME, B.DEAL_SEC_SSUB_VERTICAL_DESC, B.DEAL_SEC_SUBVERTICAL_KEY, B.DEAL_SEC_VERTICAL_KEY, B.DEAL_SEC_VVERTICAL_DESC, B.POL_DEAL_DSA_NAME, B.POL_DEAL_NUM FROM work.agent as a LEFT JOIN STAGE.master_LOOKUP AS B ON UPCASE(A.POLICY_NUMBER)=UPCASE(B.POL_NUM) ; quit;
Here, Agent table has 8731382 records and no duplicates It has 36 variables. My B table is pain it has 167171496 and has duplicates on the key column and has total 29 columns. Both of these tables are SAS tables and have indexes on respective columns. I tried with HASH join but it still takes huge time.
How can I reduce the execution time for this ? Any suggestion is highly appreciated
... View more