<?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: Possible to see generated SQL code from Proc SQL? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722274#M223932</link>
    <description>&lt;P&gt;Provide&lt;/P&gt;
&lt;P&gt;1) how you connect to the external DB&lt;/P&gt;
&lt;P&gt;2) The current Proc SQL that your executing&lt;/P&gt;
&lt;P&gt;3) describe which features of the external DB you want to use that SAS Proc SQL does not provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Proc SQL basically uses ANSI standard SQL. So general Proc SQL passes standard sql that (almost) every SQL based system uses should honor except for some SAS specific functions like date manipulation. So knowing which functions "fail" is important.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have SAS/Access to Interface to Google Bigquery licensed? The main thing that the ACCESS tools provide are things like data conversion (since SAS only supports two data types in data set variables) to most of the DB data types and the connection options. I doubt there is much if any generated SQL code involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not know the syntax for the query in the external database say so. Maybe some one can provide approaches. &lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 22:56:04 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-26T22:56:04Z</dc:date>
    <item>
      <title>Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722191#M223893</link>
      <description>&lt;P&gt;I am trying to translate a Proc SQL query to use pass-through, but to use pass-through, I have to use native SQL (the new query hits a google bigquery database).&amp;nbsp; There are some functions which are failing.&amp;nbsp; I know that Proc SQL sends things differently, or converts some code to "real" SQL.&amp;nbsp; Is there a way that I can see that?&amp;nbsp; Some option to print it to log?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 18:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722191#M223893</guid>
      <dc:creator>ProcWes</dc:creator>
      <dc:date>2021-02-26T18:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722198#M223897</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace=',,,d' sastraceloc=saslog nostsuffix;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run your query and check your log with the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=acreldb&amp;amp;docsetTarget=n0732u1mr57ycrn1urf24gzo38sc.htm&amp;amp;locale=en" target="_self"&gt;sastrace&lt;/A&gt;, &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=acreldb&amp;amp;docsetTarget=p10zkrs6rnpiv2n1b7jkrbdgq4bd.htm&amp;amp;locale=en" target="_self"&gt;sastraceloc&lt;/A&gt; and nostsuffix options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151081"&gt;@ProcWes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to translate a Proc SQL query to use pass-through, but to use pass-through, I have to use native SQL (google bigquery database).&amp;nbsp; There are some functions which are failing.&amp;nbsp; I know that Proc SQL sends things differently, or converts some code to "real" SQL.&amp;nbsp; Is there a way that I can see that?&amp;nbsp; Some option to print it to log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 17:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722198#M223897</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-26T17:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722201#M223898</link>
      <description>That doesn't seem to do anything. There are no notes in the log. Could you show me what it looks like for you?&lt;BR /&gt;&lt;BR /&gt;26 GOPTIONS ACCESSIBLE;&lt;BR /&gt;27 options sastrace=',,,d' sastraceloc=saslog nostsuffix;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;28 proc sql;&lt;BR /&gt;29 create table test as select&lt;BR /&gt;30 *,&lt;BR /&gt;31 compress(model) as c,&lt;BR /&gt;32 case when not missing(cylinders) then 1 else 0 end as m&lt;BR /&gt;33 from sashelp.cars;&lt;BR /&gt;NOTE: Compressing data set WORK.TEST decreased size by 0.00 percent.&lt;BR /&gt;Compressed is 2 pages; un-compressed would require 2 pages.&lt;BR /&gt;NOTE: Table WORK.TEST created, with 428 rows and 17 columns.&lt;BR /&gt;&lt;BR /&gt;34 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;35&lt;BR /&gt;36 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;37 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;38 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;39 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;40 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;41 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;42 %LET _SASPROGRAMFILE=;&lt;BR /&gt;43 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;44&lt;BR /&gt;45 ;*';*";*/;quit;run;&lt;BR /&gt;46 ODS _ALL_ CLOSE;</description>
      <pubDate>Fri, 26 Feb 2021 18:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722201#M223898</guid>
      <dc:creator>ProcWes</dc:creator>
      <dc:date>2021-02-26T18:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722203#M223899</link>
      <description>&lt;P&gt;SASHELP not a DB table so there won't be any extra SQL or information, your use case indicated a DB, specifically Google Big Query. &lt;BR /&gt;Check the documentation for examples of what you should see when hitting a DB table, which I linked for you in my previous reply.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 18:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722203#M223899</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-26T18:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722204#M223900</link>
      <description>My example said I am translating from an existing query to a BigQuery database which requires pass through.</description>
      <pubDate>Fri, 26 Feb 2021 18:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722204#M223900</guid>
      <dc:creator>ProcWes</dc:creator>
      <dc:date>2021-02-26T18:21:17Z</dc:date>
    </item>
    <item>
      <title>Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722205#M223902</link>
      <description>&lt;P&gt;Well thanks for trying your best.&amp;nbsp; I am hopeful that someone with more experience here will be able to reply and propose an idea!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 18:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722205#M223902</guid>
      <dc:creator>ProcWes</dc:creator>
      <dc:date>2021-02-26T18:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722206#M223903</link>
      <description>My understanding of the problem would be that you have a query, PROC SQL that you currently run via implicit pass through and you need to move to explicit pass through. To do that you would run your implicit query, either PROCs or SQL and you could then see the generated info sent to the DB. If you're not touching the DB and need to convert your queries manually, then you need to map the SAS functions to the Big Query functions manually.</description>
      <pubDate>Fri, 26 Feb 2021 18:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722206#M223903</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-26T18:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722274#M223932</link>
      <description>&lt;P&gt;Provide&lt;/P&gt;
&lt;P&gt;1) how you connect to the external DB&lt;/P&gt;
&lt;P&gt;2) The current Proc SQL that your executing&lt;/P&gt;
&lt;P&gt;3) describe which features of the external DB you want to use that SAS Proc SQL does not provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Proc SQL basically uses ANSI standard SQL. So general Proc SQL passes standard sql that (almost) every SQL based system uses should honor except for some SAS specific functions like date manipulation. So knowing which functions "fail" is important.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have SAS/Access to Interface to Google Bigquery licensed? The main thing that the ACCESS tools provide are things like data conversion (since SAS only supports two data types in data set variables) to most of the DB data types and the connection options. I doubt there is much if any generated SQL code involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not know the syntax for the query in the external database say so. Maybe some one can provide approaches. &lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 22:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722274#M223932</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-26T22:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to see generated SQL code from Proc SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722372#M223974</link>
      <description>&lt;P&gt;How about posting the complete SAS log of one of your SAS queries that is failing? We can't give specific advice without specific evidence.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 23:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Possible-to-see-generated-SQL-code-from-Proc-SQL/m-p/722372#M223974</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-02-27T23:34:04Z</dc:date>
    </item>
  </channel>
</rss>

