<?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: PROC SQL Pass Through on Multiple Databases in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395356#M95322</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our SAS/Access is not ODBC byt SAS/Access to Microsoft SQL Server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is when I tried the connection to ODBC I'm getting the error below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: The ODBC engine cannot be found.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: A Connection to the ODBC DBMS is not currently supported, or is not installed at your site.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;35 ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Connection to the ODBC DBMS does not exist.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2017 01:42:43 GMT</pubDate>
    <dc:creator>jei</dc:creator>
    <dc:date>2017-09-13T01:42:43Z</dc:date>
    <item>
      <title>PROC SQL Pass Through on Multiple Databases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395350#M95320</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create SAS dataset from SQL tables using PROC SQL Pass through. I am submitting the following command but getting the errors. May I know if it is possible to create SAS Dataset form multiple DB on SQL Server using the Proc SQL Pass through?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SAS Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;/*Get Lot Info using PROC SQL Pass-Through*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;proc sql;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;connect to SQLSVR as A (Datasrc=dload USER=user PASSWORD='password');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;connect to SQLSVR as B (Datasrc=OPS User=user PASSWORD='password');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;/*Explicit Pass-Through with SELECT*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;create table yld.Tmp_Mvmt_Dtls as &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;select &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ID, OperationNumber,Code,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Quantity, Status, Station , Description , Category,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;chrAssyYieldFlag , FlagMeasure&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;from connection to SQLSVR (A B)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;select a.ID, a.OperationNumber,a.ode,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;a.Quantity, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;, b.Status, c.Station , c.Description , c.Category&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;, c.chrAssyYieldFlag , b.FlagMeasure&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FROM [dload].[Transaction] a with (nolock) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;left join [sas].[Operations] b with (nolock) on a.OperationNumber = b.OperNumbers &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;left join [sas].[Stations] c with (nolock ) on b.StationID = c.StationIDs&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;%put %sqlxrc &amp;amp;sqlxmsg; *SQL Server Query return code and message;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;disconnect from SQLSVR;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;LOG:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;/*Get Lot Info using PROC SQL Pass-Through*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;825 proc sql;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;826&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;827 connect to SQLSVR as A (Datasrc=dload USER=user PASSWORD='password');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;828 connect to SQLSVR as B (Datasrc=OPS User=user PASSWORD='password');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;831&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;832 /*Explicit Pass-Through with SELECT*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;833 create table yld.Tmp_Mvmt_Dtls as&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;834 select&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;835 ID, OperationNumber,Code,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;836 Quantity, Status, Station , Description , Category,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;837 chrAssyYieldFlag , FlagMeasure&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;841&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;842 from connection to SQLSVR (A B)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;843 (&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;-&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;22&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;76&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: ',', EXCEPT, GROUP, HAVING, INTERSECT,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;JOIN, ORDER, UNION, WHERE.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;844 select a.ID, a.OperationNumber,a.ode,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;845 a.Quantity, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;846 , b.Status, c.Station , c.Description , c.Category&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;847 , c.chrAssyYieldFlag , b.FlagMeasure&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;848 FROM [dload].[Transaction] a with (nolock) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;849 left join [sas].[Operations] b with (nolock) on a.OperationNumber = b.OperNumbers &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;850 left join [sas].[Stations] c with (nolock ) on b.StationID = c.StationIDs&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;851 );&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;852 ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;853 %put %sqlxrc &amp;amp;sqlxmsg; *SQL Server Query return code and message;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WARNING: Apparent invocation of macro SQLXRC not resolved.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;%sqlxrc&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;854 disconnect from SQLSVR;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Connection to the SQLSVR DBMS does not exist.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;855 quit;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 00:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395350#M95320</guid>
      <dc:creator>jei</dc:creator>
      <dc:date>2017-09-13T00:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Pass Through on Multiple Databases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395352#M95321</link>
      <description>&lt;P&gt;Yes it is. You need to connect directly to your SQL Server servername in one connection only then refer to your tables including the database name, schema name and table name like so (using ODBC as an example):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 connect to odbc (noprompt = "server=MyServerName;DRIVER=SQL Server;uid=myusr1;pwd=mypwd1;");
  create table Want  as 
  select * from connection to odbc
  (SELECT *
   FROM [MyDatabase].[MySchema1].[MyTable]
   )
  ;
  disconnect from odbc;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 01:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395352#M95321</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-13T01:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Pass Through on Multiple Databases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395356#M95322</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our SAS/Access is not ODBC byt SAS/Access to Microsoft SQL Server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is when I tried the connection to ODBC I'm getting the error below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: The ODBC engine cannot be found.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: A Connection to the ODBC DBMS is not currently supported, or is not installed at your site.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;35 ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Connection to the ODBC DBMS does not exist.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 01:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395356#M95322</guid>
      <dc:creator>jei</dc:creator>
      <dc:date>2017-09-13T01:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Pass Through on Multiple Databases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395360#M95323</link>
      <description>&lt;P&gt;I wasn't suggesting you try ODBC. Use your SQLSVR connection to just connect to the SQL Server itself and not a particular database, then try the type of query I put in my previous post.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 02:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395360#M95323</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-13T02:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Pass Through on Multiple Databases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395372#M95326</link>
      <description>Okay. I did your suggestion. It worked!&lt;BR /&gt;&lt;BR /&gt;Thank you so much!</description>
      <pubDate>Wed, 13 Sep 2017 03:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Pass-Through-on-Multiple-Databases/m-p/395372#M95326</guid>
      <dc:creator>jei</dc:creator>
      <dc:date>2017-09-13T03:30:37Z</dc:date>
    </item>
  </channel>
</rss>

