<?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 Re: CLI describe error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789756#M252764</link>
    <description>&lt;P&gt;Run a simple query e.g. &lt;FONT face="courier new,courier"&gt;select count(*) from shopping_2021&lt;/FONT&gt; does it work?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you get the same error, then you have some kind of connection issue.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Have you been able to access this table in the past?&lt;/LI&gt;
&lt;LI&gt;When did you last access it successfully?&lt;/LI&gt;
&lt;LI&gt;What changed?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If the simple query runs, then start building your complex query up, step by step adn testing it each step of the way.&lt;/P&gt;
&lt;P&gt;Until you determine what is breaking it&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 17:03:13 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2022-01-12T17:03:13Z</dc:date>
    <item>
      <title>CLI describe error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789743#M252759</link>
      <description>&lt;P&gt;Hi, I would like to select two member information, normal member can be identity by member ID, whereas premium member can be identified by PREM_MEMBER_ID. Each member has an unique member_key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each member_id can be identified by member_id, user_name or google_account.&lt;/P&gt;
&lt;P&gt;The script as below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;connect to TARGETSVR as DESKTOP(datasrc="COMPANY" authdomain="");

select compress("'"||%nrquote(MEMBER_KEY)||"'") into: MEMBER_KEY separated by ',' &lt;BR /&gt;from connection to DESKTOP
    (select distinct * from SHOPPING_2021
	where (MEMBER_ID = %str(&amp;amp;MEMBER_ID.) OR USER_NAME = %str(&amp;amp;MEMBER_ID.) OR &lt;BR /&gt;    (GOOGLE_ACCOUNT = %str(&amp;amp;MEMBER_ID.) &amp;amp;DOB.))
	);

select compress("'"||%nrquote(MEMBER_KEY)||"'") into: PREM_MEMBER_KEY separated by ',' &lt;BR /&gt;from connection to SQLTGT
	(select distinct * from SHOPPING_2021 
     where MEMBER_ID = %str(&amp;amp;PREM_MEMBER_ID.) OR USER_NAME = %str(&amp;amp;PREM_MEMBER_ID.) OR &lt;BR /&gt;     (GOOGLE_ACCOUNT = %str(&amp;amp;PREM_MEMBER_ID.) &amp;amp;PREM_DOB_Filt.)
	 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I get error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: CLI describe error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near ')'. : [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]The batch could not be analyzed because of compile errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I fix this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 15:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789743#M252759</guid>
      <dc:creator>sarahzhou</dc:creator>
      <dc:date>2022-01-12T15:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: CLI describe error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789756#M252764</link>
      <description>&lt;P&gt;Run a simple query e.g. &lt;FONT face="courier new,courier"&gt;select count(*) from shopping_2021&lt;/FONT&gt; does it work?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you get the same error, then you have some kind of connection issue.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Have you been able to access this table in the past?&lt;/LI&gt;
&lt;LI&gt;When did you last access it successfully?&lt;/LI&gt;
&lt;LI&gt;What changed?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If the simple query runs, then start building your complex query up, step by step adn testing it each step of the way.&lt;/P&gt;
&lt;P&gt;Until you determine what is breaking it&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 17:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789756#M252764</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-01-12T17:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: CLI describe error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789759#M252765</link>
      <description>&lt;P&gt;What is the purpose of using %nrquote(Member_key)? From the code usage Member_key should be a variable in a data set and should not require macro quoting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I strongly suggest showing us the LOG for the entire Proc SQL (or which ever procedure you are using) to include all of the notes, messages and errors. Copy the text from the log, open a text box on the forum with the &amp;lt;/&amp;gt; icon that appears above the message window and then paste the text. XXXX out any sensitive connection elements like passwords if present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a hunch that perhaps other issues may be involved.&lt;/P&gt;
&lt;P&gt;Perhaps you are overusing macro quoting functions and maybe should be using something more like:&lt;/P&gt;
&lt;PRE&gt;where MEMBER_ID = "&amp;amp;MEMBER_ID."&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 17:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789759#M252765</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-12T17:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: CLI describe error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789820#M252788</link>
      <description>&lt;P&gt;It's near impossible to help you because a lot of your SQL logic is buried in macro variables and you haven't provided the values for these.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post your complete SAS log after adding this - options mprint symbolgen; - to the start of your program. This should print what is in your macro variables in the log.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 21:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789820#M252788</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-01-12T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: CLI describe error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789872#M252821</link>
      <description>You're using explicit SQL Pass thru so your SQL needs to be SQL Server compliant, not SAS SQL and your code looks like it's all SQL. &lt;BR /&gt;&lt;BR /&gt;You're asking SQL server to create macro variables but SQL server doesn't really have the same concept. &lt;BR /&gt;select compress("'"||%nrquote(MEMBER_KEY)||"'") into: MEMBER_KEY separated by ',' from connection to DESKTOP&lt;BR /&gt;&lt;BR /&gt;Unless I'm missing something you're using the entirely wrong approach to whatever you're trying to do here.</description>
      <pubDate>Thu, 13 Jan 2022 02:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/789872#M252821</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-13T02:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: CLI describe error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/790016#M252906</link>
      <description>&lt;P&gt;Hi, thank you for your reply. Your advice really give me the insight to solve my issues. I added another macro variable in my script, and it run success. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 16:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CLI-describe-error/m-p/790016#M252906</guid>
      <dc:creator>sarahzhou</dc:creator>
      <dc:date>2022-01-13T16:22:23Z</dc:date>
    </item>
  </channel>
</rss>

