06-16-2015 04:35 PM
Hi, I'm not that familiar with the update step in SAS. I have a code in Teradata that uses update, and I need to find the equivalent in proc sql.. However, I'm not sure if the way I have it set out is the most optimal way. In my Proc SQL, it's taking way to long to process.
Teradata SQl Code:
FROM BAL_TABLE A
SET CURR_STRT_DT = SNAP_DT
WHERE ACCT_TABLE.ARQ_ID = A.ARQ_ID
AND ACCT_TABLE.OD_CURR_STRT_DT IS NULL
AND ACCT_TABLE.ACCT_OPEN_CLS_STS = 'O'
AND A.BAL_INCL_B < 0
PROC SQL (My)
update ACCT_TABLE B
set CURR_STRT_DT = (select SNAP_DT from BAL_TABLE A
WHERE A.ARQ_ID = B.ARQ_ID
AND B.SNAP_DT is NULL
AND B.ACCT_OPEN_CLS_STS = 'O'
AND A.BAL_INCL_B < 0)
06-16-2015 08:13 PM
The tables are originally from Teradata, but I was able to bring them locally into my SAs server, and I have to update them there. Using the second code.
06-16-2015 08:22 PM
if you have both tables in Teradata, if possible please run an explain plan and check what it tell you. How large are this tables. if you both tables in Teradata, it is always a good practice to do it in Teradata