Hello, I'm having some issues with running some code, and hoping someone might have insight into what's going on. It's a pretty simple code that I'm running off a corporate database (I believe it's Teradata-based). However, when I run my code using (SELECT xxx from LIST) in the WHERE function, SAS runs for an extremely long time before timing out. However, when I use the same 85 values from LIST (example: 100, 200, 300) in my WHERE function, the query returns my results pretty quickly. I'm trying to troubleshoot this problem, but not seeing any reason for the query to not work. Here's an example for how this query is put together: proc sql; CREATE TABLE MKTLISTING AS SELECT MKTSTATE, MKTNBR FROM MKT_TBL WHERE MKTSTATE in ('NY') /*This results in numeric MKTNBRs 100,200,300*/ ; RUN proc sql; CREATE TABLE products AS SELECT C.PRODCD ,C.PRODTYP ,C.PRODMAN ,S.SALESAREA ,S.MKTNBR FROM PRODTBL C , SALESTBL S WHERE C.PRODCD = S.PROD CD AND S.MKTNBR in (SELECT MKTNBR FROM MKTLISTING) /*Using this causes the query to timeout, but works fine when (100,200,300) is used in place*/ ; QUIT; Any clues to why this occurs would be greatly appreciated!
... View more