Hi all, I am after suggestions on the following issue I have. My systems allow me access to data on Teradata via SAS EG, but this gives me issues with joins when passing sql to Teradata. SAS Code: Code is bring back data for customers from a list of say 10k customers for particular dates from a table that holds the accounts and dates required (tmp1). The daily snapshot data is in tera.daily_snapshot_table proc sql; create table test1 as ( select a.acct, a.id_date, a.somedata1, a.somedata2 from tera.daily_snapshot_table a where a.acct in (select distinct acct from tmp1) and a.id_date in (select distinct id_date from tmp1) ); quit; SAS is unable to join the tables together, so instead pulls everything down from the tera view and then does the extra filtering in SAS. This is what I have found very slow. Here is the actual SQL that is running in Teradata for your query, as you can see no reference to my accounts or snapshot dates and will return an estimated 291 million rows!!! SELECT "acct", "ID_DATE", CAST("somedata1" AS FLOAT), CAST("somedata2" AS FLOAT), FROM "TERA_VIEWS"."daily_snapshot_table"; I don't have access to Teradata directly and the DBA has told me what it is doing...but he unfortunately doesn't have SAS experience to fix this. So what would be the best way to generate code that will pass though the values to Teradata to enable just the customers/dates I want to be returned? many thanks
... View more