<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic where statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807298#M33617</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am using an existing code which runs okay but when I am adding where&amp;nbsp;b.client_code &lt;STRONG&gt;like "%Vanquis%"&lt;/STRONG&gt;, I am getting ERROR: Describe error: IColumnsInfo::GetColumnInfo failed. : Deferred prepare could not be completed.: Statement(s) could not be&lt;BR /&gt;prepared.: Invalid column name '%Vanquis%'.&lt;BR /&gt;(from [Pinsys].[dbo].[debt_trans] as b&lt;BR /&gt;65 inner join [Pinsys].[dbo].[transdescrn] as c&lt;BR /&gt;66 on b.Tran_code = c.Tran_code&lt;BR /&gt;67 where b.tx_date &amp;gt;= &amp;amp;Start_trace and&lt;BR /&gt;68 b.tx_date &amp;lt;= &amp;amp;End_Trace and&lt;BR /&gt;69 b.client_code like "%Vanquis%"&lt;BR /&gt;WARNING: Apparent invocation of macro VANQUIS not resolved.&lt;BR /&gt;70&lt;BR /&gt;71 and b.tran_code in ('MO9741','MO9742','MO9743','MO9744','MO9745','MO9746','MO9747','MO9748');)) as t2&lt;BR /&gt;72&lt;BR /&gt;73 order by t2.debt_code, t2.tx_date&lt;BR /&gt;74 ;&lt;BR /&gt;ERROR: Describe error: IColumnsInfo::GetColumnInfo failed. : Deferred prepare could not be completed.: Statement(s) could not be&lt;BR /&gt;prepared.: Invalid column name '%Vanquis%'.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;75 quit;)&lt;/P&gt;&lt;P&gt;I am using the below code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to oledb (provider=sqlncli11.1&lt;BR /&gt;properties = ("Integrated Security" = SSPI&lt;BR /&gt;"Persist Security Info" = False&lt;BR /&gt;"Initial Catalog" = pinsys&lt;BR /&gt;prompt = NO&lt;BR /&gt;"Data Source" = 'ELECTRA'&lt;BR /&gt;read_lock_type = no));&lt;BR /&gt;create table Manual_table as&lt;BR /&gt;select t2.debt_code,&lt;BR /&gt;t2.tran_code,&lt;BR /&gt;datepart(t2.tx_date) as Trace_date format date9.,&lt;BR /&gt;input(t2.tx_time,time8.) as trace_time format time8.,&lt;BR /&gt;t2.dt_tx_date as Trace_dt,&lt;BR /&gt;t2.tx_manauto,&lt;BR /&gt;t2.td_stddescrn&lt;/P&gt;&lt;P&gt;from (select * from connection to oledb&lt;BR /&gt;(select&lt;BR /&gt;b.debt_code,&lt;BR /&gt;b.tran_code,&lt;BR /&gt;b.tx_date,&lt;BR /&gt;b.tx_time,&lt;BR /&gt;b.dt_tx_date,&lt;BR /&gt;b.tx_manauto,&lt;BR /&gt;b.client_code&lt;BR /&gt;from [Pinsys].[dbo].[debt_trans] as b&lt;BR /&gt;inner join [Pinsys].[dbo].[transdescrn] as c&lt;BR /&gt;on b.Tran_code = c.Tran_code&lt;BR /&gt;where b.tx_date &amp;gt;= &amp;amp;Start_trace and&lt;BR /&gt;b.tx_date &amp;lt;= &amp;amp;End_Trace and&lt;BR /&gt;b.client_code &lt;STRONG&gt;like "%Vanquis%"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;and b.tran_code in ('MO9741','MO9742','MO9743','MO9744','MO9745','MO9746','MO9747','MO9748');)) as t2&lt;/P&gt;&lt;P&gt;order by t2.debt_code, t2.tx_date&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 07:25:38 GMT</pubDate>
    <dc:creator>Sandeep77</dc:creator>
    <dc:date>2022-04-12T07:25:38Z</dc:date>
    <item>
      <title>where statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807298#M33617</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am using an existing code which runs okay but when I am adding where&amp;nbsp;b.client_code &lt;STRONG&gt;like "%Vanquis%"&lt;/STRONG&gt;, I am getting ERROR: Describe error: IColumnsInfo::GetColumnInfo failed. : Deferred prepare could not be completed.: Statement(s) could not be&lt;BR /&gt;prepared.: Invalid column name '%Vanquis%'.&lt;BR /&gt;(from [Pinsys].[dbo].[debt_trans] as b&lt;BR /&gt;65 inner join [Pinsys].[dbo].[transdescrn] as c&lt;BR /&gt;66 on b.Tran_code = c.Tran_code&lt;BR /&gt;67 where b.tx_date &amp;gt;= &amp;amp;Start_trace and&lt;BR /&gt;68 b.tx_date &amp;lt;= &amp;amp;End_Trace and&lt;BR /&gt;69 b.client_code like "%Vanquis%"&lt;BR /&gt;WARNING: Apparent invocation of macro VANQUIS not resolved.&lt;BR /&gt;70&lt;BR /&gt;71 and b.tran_code in ('MO9741','MO9742','MO9743','MO9744','MO9745','MO9746','MO9747','MO9748');)) as t2&lt;BR /&gt;72&lt;BR /&gt;73 order by t2.debt_code, t2.tx_date&lt;BR /&gt;74 ;&lt;BR /&gt;ERROR: Describe error: IColumnsInfo::GetColumnInfo failed. : Deferred prepare could not be completed.: Statement(s) could not be&lt;BR /&gt;prepared.: Invalid column name '%Vanquis%'.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;75 quit;)&lt;/P&gt;&lt;P&gt;I am using the below code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to oledb (provider=sqlncli11.1&lt;BR /&gt;properties = ("Integrated Security" = SSPI&lt;BR /&gt;"Persist Security Info" = False&lt;BR /&gt;"Initial Catalog" = pinsys&lt;BR /&gt;prompt = NO&lt;BR /&gt;"Data Source" = 'ELECTRA'&lt;BR /&gt;read_lock_type = no));&lt;BR /&gt;create table Manual_table as&lt;BR /&gt;select t2.debt_code,&lt;BR /&gt;t2.tran_code,&lt;BR /&gt;datepart(t2.tx_date) as Trace_date format date9.,&lt;BR /&gt;input(t2.tx_time,time8.) as trace_time format time8.,&lt;BR /&gt;t2.dt_tx_date as Trace_dt,&lt;BR /&gt;t2.tx_manauto,&lt;BR /&gt;t2.td_stddescrn&lt;/P&gt;&lt;P&gt;from (select * from connection to oledb&lt;BR /&gt;(select&lt;BR /&gt;b.debt_code,&lt;BR /&gt;b.tran_code,&lt;BR /&gt;b.tx_date,&lt;BR /&gt;b.tx_time,&lt;BR /&gt;b.dt_tx_date,&lt;BR /&gt;b.tx_manauto,&lt;BR /&gt;b.client_code&lt;BR /&gt;from [Pinsys].[dbo].[debt_trans] as b&lt;BR /&gt;inner join [Pinsys].[dbo].[transdescrn] as c&lt;BR /&gt;on b.Tran_code = c.Tran_code&lt;BR /&gt;where b.tx_date &amp;gt;= &amp;amp;Start_trace and&lt;BR /&gt;b.tx_date &amp;lt;= &amp;amp;End_Trace and&lt;BR /&gt;b.client_code &lt;STRONG&gt;like "%Vanquis%"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;and b.tran_code in ('MO9741','MO9742','MO9743','MO9744','MO9745','MO9746','MO9747','MO9748');)) as t2&lt;/P&gt;&lt;P&gt;order by t2.debt_code, t2.tx_date&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807298#M33617</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-04-12T07:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807301#M33618</link>
      <description>&lt;P&gt;The error comes from the external DBMS. Make sure that the code in the explicit pass-through conforms to the syntax rules of the database provider. See how LIKE strings need to be written in your specific DB.&lt;/P&gt;
&lt;P&gt;The SAS WARNING about the missing macro may be avoided by using single quotes, and that might also fix the error if the DB requires single quotes there. But you need to check that with the DB documentation, or ask your local DB admins/developers.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807301#M33618</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-12T07:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807303#M33619</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement/m-p/807303#M33619</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-04-12T07:42:22Z</dc:date>
    </item>
  </channel>
</rss>

