title: working of where condition in sas proc sql, while connecting to some other database
body: <p>I am working on a table with more that 30 million records.The table is on sybase and i am working on sas. There is a feed_key(numeric) variable which contains the time stamp for the record entry. I wanted to pull records for a particular time frame.</p>
  
  <pre><code>proc sql ;
  Connect To Sybase (user="id" pass="password" server=concho);
  create table table1 as
  select * from connection to sybase
  (
  select a.feed_key as feed_key,
                a.cm15,
                a.country_cd,
                a.se10,
                convert(char(10),a.se10) as se_num,
                a.trans_dt,
                a.appr_deny_cd,
                a.approval_cd,
                a.amount        
           from abc.xyz a
    where a.country_cd in ('ABC') and a.appr_deny_cd in ('0','1','6') and a.approval_cd not in ('123456') and feed_key &gt; 12862298
  );
  disconnect from sybase;
  quit;
  </code></pre>
  
  <p>it is pulling same no of records, irrespective of whether i put the feed_key condition or not, and it is taking almost same time to execute(16 mins without feek_key condition and 15 mins with feed_key condition) the query.</p>
  
  <p>please clarify the working of where clause in this case.</p>
  
  <p>as i believe the feed_key condition should have made the query run much faster as more than 80% of records do not match this condition....</p>