<?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: converting SQL pass through code having with function to normal SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/482010#M124787</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i'm able to resolve this issue, Basically the SQL-pass through i mentioned was using the execute query as below which submits the code to database which is having stored procedures and return back the results. All-though its nothing to do with pre-assigned libraries or SQL-pass thru it was probelm with stored procs, So we had same stored procs copied and it worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;execute executeoraclequery @query =&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jul 2018 19:41:00 GMT</pubDate>
    <dc:creator>maheshtalla</dc:creator>
    <dc:date>2018-07-27T19:41:00Z</dc:date>
    <item>
      <title>converting SQL pass through code having with function to normal SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478836#M123512</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have sql pass-through code as below and get data using ODBC connection. can some help and suggest how to use with on pre-assigned libraries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp;connect to odbc as mydb&lt;BR /&gt;&amp;nbsp;(datasrc=dwprdsvc user=xxxxxxxxxxxx&amp;nbsp;password=xxxxxxxxxxxxxxxxx);&lt;BR /&gt; create table Var_tmp as select * from connection to mydb (&lt;BR /&gt;&amp;nbsp;SET QUOTED_IDENTIFIER OFF&lt;BR /&gt;&amp;nbsp;execute executeoraclequery @query =&amp;nbsp;&lt;BR /&gt; %bquote(")&lt;BR /&gt; /* all the latest scenario forecasts */&lt;BR /&gt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;with&lt;/STRONG&gt;&lt;/FONT&gt; LATEST as (&lt;BR /&gt; select query...&lt;BR /&gt; ),&lt;/P&gt;
&lt;P&gt;DATA as (&lt;BR /&gt; select query...&lt;BR /&gt; ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;now i have pre-assigned library and i'm not able to convert it to required format...&lt;/P&gt;
&lt;P&gt;when i converted as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table Oxford_Eco_Var_tmp as select * from&amp;nbsp; (&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;with LATEST as (&lt;/P&gt;
&lt;P&gt;select query...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;),&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATA as (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select query...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;i'm getting error as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table Var_tmp as select * from&amp;nbsp; (&lt;/P&gt;
&lt;P&gt;28&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;with LATEST as (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: ',', ANSIMISS, CROSS, FULL, INNER, JOIN, LEFT, NATURAL, NOMISS, RIGHT.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 201-322: The option is not recognized and will be ignored.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please suggest and let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 21:03:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478836#M123512</guid>
      <dc:creator>maheshtalla</dc:creator>
      <dc:date>2018-07-17T21:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: converting SQL pass through code having with function to normal SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478842#M123514</link>
      <description>&lt;P&gt;Your question makes no sense to me.&lt;/P&gt;
&lt;P&gt;1. WITH creates a sort of a code shortcut, a view in a sense. It has nothing to do with libnames&lt;/P&gt;
&lt;P&gt;2. WITH is not supported in SAS SQL&lt;/P&gt;
&lt;P&gt;What are you trying to achieve?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 21:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478842#M123514</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-17T21:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: converting SQL pass through code having with function to normal SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478845#M123515</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the initial query work well with SQL-passthrough with odbc connection details with in that...but i have setup libraries to the database and pre-assigned them. now I modified the code accordingly and its not working.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 21:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478845#M123515</guid>
      <dc:creator>maheshtalla</dc:creator>
      <dc:date>2018-07-17T21:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: converting SQL pass through code having with function to normal SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478847#M123516</link>
      <description>&lt;P&gt;You code should then look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname MYLIB odbc&amp;nbsp;datasrc=dwprdsvc user=xxxxxxxx&amp;nbsp;password=xxxxxxxxx;

proc&amp;nbsp;sql;
&amp;nbsp; connect using MYLIB;
 &amp;nbsp;create table Oxford_Eco_Var_tmp as select * from connection to MYLIB (
 &amp;nbsp; &amp;nbsp;with LATEST as ( ... )
&amp;nbsp;  &amp;nbsp;etc
&amp;nbsp; );
&amp;nbsp;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 21:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/478847#M123516</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-17T21:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: converting SQL pass through code having with function to normal SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/482010#M124787</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i'm able to resolve this issue, Basically the SQL-pass through i mentioned was using the execute query as below which submits the code to database which is having stored procedures and return back the results. All-though its nothing to do with pre-assigned libraries or SQL-pass thru it was probelm with stored procs, So we had same stored procs copied and it worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;execute executeoraclequery @query =&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 19:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-SQL-pass-through-code-having-with-function-to-normal/m-p/482010#M124787</guid>
      <dc:creator>maheshtalla</dc:creator>
      <dc:date>2018-07-27T19:41:00Z</dc:date>
    </item>
  </channel>
</rss>

