<?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 connect to DB2 database error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597760#M172260</link>
    <description>&lt;P&gt;proc sql;&lt;BR /&gt;connect to db2 (user='423423' password='fwewerwr' database='sdfsdf' host='fwerwerwe');&lt;BR /&gt;create table table_abc (compress=yes) as select* from connection to db2 (&lt;BR /&gt;select *&lt;BR /&gt;from table2&lt;BR /&gt;where status ='A');&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Executing from SAS 9.4 for windows&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The DB2 engine cannot be found.&lt;BR /&gt;ERROR: A Connection to the db2 DBMS is not currently supported, or is not installed at your&lt;BR /&gt;site.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 15:49:27 GMT</pubDate>
    <dc:creator>radha009</dc:creator>
    <dc:date>2019-10-18T15:49:27Z</dc:date>
    <item>
      <title>connect to DB2 database error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597760#M172260</link>
      <description>&lt;P&gt;proc sql;&lt;BR /&gt;connect to db2 (user='423423' password='fwewerwr' database='sdfsdf' host='fwerwerwe');&lt;BR /&gt;create table table_abc (compress=yes) as select* from connection to db2 (&lt;BR /&gt;select *&lt;BR /&gt;from table2&lt;BR /&gt;where status ='A');&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Executing from SAS 9.4 for windows&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The DB2 engine cannot be found.&lt;BR /&gt;ERROR: A Connection to the db2 DBMS is not currently supported, or is not installed at your&lt;BR /&gt;site.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 15:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597760#M172260</guid>
      <dc:creator>radha009</dc:creator>
      <dc:date>2019-10-18T15:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: connect to DB2 database error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597770#M172268</link>
      <description>&lt;P&gt;Whenever I need to do SQL Pass-Through I use this:&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 ("dsn={name here}");
CREATE TABLE {Table Name} AS
SELECT * FROM connection to odbc
(
SELECT {Column}
FROM Table
);
DISCONNECT FROM odbc;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I personally don't have access to use the db2 connection method but I believe you would need to do it like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect to db2 (user=_______ database=_______ password=_______);
execute( CREATE TABLE {Table Name} AS
SELECT * FROM connection to odbc
(SELECT {Column}
FROM Table) by db2;
disconnect from db2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Oct 2019 16:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597770#M172268</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-10-18T16:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: connect to DB2 database error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597786#M172277</link>
      <description>&lt;P&gt;you might need to have the DB2 client installed on your work-station&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 17:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597786#M172277</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-10-18T17:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: connect to DB2 database error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597789#M172280</link>
      <description>How about username and password to dB connection.&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Oct 2019 17:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597789#M172280</guid>
      <dc:creator>radha009</dc:creator>
      <dc:date>2019-10-18T17:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: connect to DB2 database error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597814#M172292</link>
      <description>&lt;P&gt;DSN is something you have pre-configured.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;-- This would be at the top of your code
libname rptLib odbc dsn=rpt_Lib_name schema=dbo spool=NO;


--You would then reference it like this.

PROC SQL;
CREATE TABLE Test AS
SELECT *
    FROM rptLib.Table
;QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you have this then you can use the first snippet. If not then you'll need to configure the connection with DB2 which would require UserName, Password and Database.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 19:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/connect-to-DB2-database-error/m-p/597814#M172292</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-10-18T19:02:57Z</dc:date>
    </item>
  </channel>
</rss>

