<?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: Multiple select in sas sql passthrough in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608016#M176887</link>
    <description>&lt;P&gt;Here is a screenshot of the code I am sharing.please let me know if you see any error.&lt;/P&gt;&lt;P&gt;Sorry i cant post the code&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2019 09:38:48 GMT</pubDate>
    <dc:creator>nid197</dc:creator>
    <dc:date>2019-11-28T09:38:48Z</dc:date>
    <item>
      <title>Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607706#M176717</link>
      <description>Hi,&lt;BR /&gt;Can anyone help me with below select query.writting the sample query due to internet access issues at workplace&lt;BR /&gt;&lt;BR /&gt;Proc sql,&lt;BR /&gt;Connect to teradata as tera(server"eiwb." Authdomain="sgkac." Mode=teradata)&lt;BR /&gt;Create table abc as select * from connection to teradata(&lt;BR /&gt;Select&lt;BR /&gt;Y.accno,&lt;BR /&gt;Y.transactionky,&lt;BR /&gt;Case when()&lt;BR /&gt;Case when()&lt;BR /&gt;..........&lt;BR /&gt;from&lt;BR /&gt;(&lt;BR /&gt;Select X.accno,&lt;BR /&gt;X.transactionky,&lt;BR /&gt;Count(X.transcount) as transcnt,&lt;BR /&gt;Log(acd) as acd2,&lt;BR /&gt;Log(brd) as brd2,&lt;BR /&gt;From(&lt;BR /&gt;Select a.transactionky key,b.accno,&lt;BR /&gt;Max(gsj) as jsh,&lt;BR /&gt;Log.........&lt;BR /&gt;from&lt;BR /&gt;Kcseg.cashflow a join&lt;BR /&gt;Kcseg.accountdm b&lt;BR /&gt;On a.accountno=b.accountno&lt;BR /&gt;Where accountno in (527828,6272929,5262828) and a.datekey between 20190801 and 20190831&lt;BR /&gt;Group by&lt;BR /&gt;b.accountno,a.transactionky&lt;BR /&gt;)x&lt;BR /&gt;Group by accountno,transactionky&lt;BR /&gt;)y&lt;BR /&gt;)by tera;&lt;BR /&gt;Disconnect from tera;&lt;BR /&gt;Quit;&lt;BR /&gt;&lt;BR /&gt;Please help if i have it the right way.because the query is giving me results in teradata but using sas passthrough it is giving syntax error 22-322:</description>
      <pubDate>Wed, 27 Nov 2019 14:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607706#M176717</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-11-27T14:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607710#M176720</link>
      <description>Here there is no option of uploading images.if someone can help me with this i can email a picture of a query.Thanks!</description>
      <pubDate>Wed, 27 Nov 2019 14:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607710#M176720</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-11-27T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607714#M176721</link>
      <description>&lt;P&gt;Only use pictures for something that&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; in fact a picture. Code has to be posted with the "little running man" icon, logs and other textual data (or non-SAS code, like shell scripts) with the {i} button.&lt;/P&gt;
&lt;P&gt;Such data or code is best copy/pasted into the subwindow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pictures can be posted with the "Photos" button.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 14:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607714#M176721</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-27T14:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607715#M176722</link>
      <description>&lt;P&gt;You made a connection named TERA and then are trying to use a connection named TERADATA in your SAS side SELECT statement.&amp;nbsp; You also included a spurious BY TERA at the end of your CREATE TABLE statement.&lt;/P&gt;
&lt;P&gt;Your code should follow this format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;connect to Y  ... ;
select ... from connection to Y (....);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if you want to rename the connection use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;connect to Y as X ... ;
select ... from connection to X (....);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The documentation on the EXECUTE statement has that BY X syntax at the end:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;execute (....) by X;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But someone pointed out recently that it is possible to move the connection name to the front. Like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;execute by X (....);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For this type of question it is best to show the lines from the log where SAS has tagged the confusing code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember to use the Insert Code button on the menu bar of the edit form (looks like {i}) to get a pop-up window to paste the lines so that the formatting is preserved.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 15:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607715#M176722</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-27T15:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607718#M176723</link>
      <description>&lt;PRE&gt;Proc sql,
Connect to teradata as tera(server"eiwb." Authdomain="sgkac." Mode=teradata)
Create table abc as select * from connection to teradata(&lt;/PRE&gt;
&lt;P&gt;Three immediate issues:&lt;/P&gt;
&lt;P&gt;Comma instead of semicolon to end the proc sql statement.&lt;/P&gt;
&lt;P&gt;No semicolon to end the connect statement&lt;/P&gt;
&lt;P&gt;Missing equals sign in server"eiwb.".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 14:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607718#M176723</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-27T14:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607726#M176727</link>
      <description>Yes sorry for the tpying mistake&lt;BR /&gt;1.there is a semicolon after connect&lt;BR /&gt;2.there is a semicolon at the end&lt;BR /&gt;3.there is a equal sign in eiwb statement&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Nov 2019 15:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607726#M176727</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-11-27T15:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607758#M176739</link>
      <description>&lt;P&gt;Using SQL Passthrough you should be able to copy paste your working SQL code into the passthrough statement. Is your SQL code working on it's own in it's respective DBMS?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 15:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607758#M176739</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-11-27T15:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607815#M176762</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132373"&gt;@nid197&lt;/a&gt;&amp;nbsp; - Copying and pasting code will avoid typos.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 19:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/607815#M176762</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-11-27T19:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608011#M176885</link>
      <description>&lt;P&gt;Yes it is working and giving me desired results in teradata&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 09:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608011#M176885</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-11-28T09:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608016#M176887</link>
      <description>&lt;P&gt;Here is a screenshot of the code I am sharing.please let me know if you see any error.&lt;/P&gt;&lt;P&gt;Sorry i cant post the code&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 09:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608016#M176887</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-11-28T09:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608029#M176892</link>
      <description>&lt;P&gt;Please read the comments above! Why bother asking questions otherwise?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As stated:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Do not paste code as images&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. You have an extraneous&amp;nbsp; &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;by TERA&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp; after the select query. This is invalid syntax.&lt;/P&gt;
&lt;P&gt;You'll notice that this happens to be underlined in the log. It is not a coincidence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Use the log. It's here to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 11:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608029#M176892</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-11-28T11:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple select in sas sql passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608140#M176939</link>
      <description>&lt;P&gt;Is your question answered? If so mark the thread as solved. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 23:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-select-in-sas-sql-passthrough/m-p/608140#M176939</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-11-28T23:09:25Z</dc:date>
    </item>
  </channel>
</rss>

