<?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: Insert a SAS Dataset into a SQL database using passthrough in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38169#M9759</link>
    <description>Hello pkr,&lt;BR /&gt;
&lt;BR /&gt;
I'm afraid this won't be possible. With SQL pass through, the sql is executed directly by the database management system (The SQL must follow the syntax in use at dbms level). The dbms has no view on your SAS datasets. &lt;BR /&gt;
&lt;BR /&gt;
If you want to insert data in a table, the best solution is to connect to the ODBC database using a libname statement. This should look like this:&lt;BR /&gt;
libname dta ODBC dsn="&amp;amp;DbDsn";&lt;BR /&gt;
&lt;BR /&gt;
The insert would look like this:&lt;BR /&gt;
insert into dta.ITGCostCurves .... select ...&lt;BR /&gt;
&lt;BR /&gt;
The "select" would be in SAS syntax. &lt;BR /&gt;
&lt;BR /&gt;
Hope this helps,&lt;BR /&gt;
&lt;BR /&gt;
Yoba

Message was edited by: yoba</description>
    <pubDate>Thu, 28 May 2009 18:24:36 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-05-28T18:24:36Z</dc:date>
    <item>
      <title>Insert a SAS Dataset into a SQL database using passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38168#M9758</link>
      <description>Can I insert data from a sas dataset into a sql table using passthrough?  I have a sas dataset called inputdataset.  I am using the following code to insert that into the database but the sas dataset is not recognized.&lt;BR /&gt;
&lt;BR /&gt;
	Proc SQL noprint;&lt;BR /&gt;
		Connect to odbc as FTP(required = "Dsn=&amp;amp;DbDsn");&lt;BR /&gt;
		Execute (Insert into ITGCostCurves&lt;BR /&gt;
				 Select *, &amp;amp;PeriodDate as TimePeriod from InputDataSet) by FTP;&lt;BR /&gt;
		disconnect from FTP;&lt;BR /&gt;
	quit;</description>
      <pubDate>Thu, 28 May 2009 16:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38168#M9758</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T16:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a SAS Dataset into a SQL database using passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38169#M9759</link>
      <description>Hello pkr,&lt;BR /&gt;
&lt;BR /&gt;
I'm afraid this won't be possible. With SQL pass through, the sql is executed directly by the database management system (The SQL must follow the syntax in use at dbms level). The dbms has no view on your SAS datasets. &lt;BR /&gt;
&lt;BR /&gt;
If you want to insert data in a table, the best solution is to connect to the ODBC database using a libname statement. This should look like this:&lt;BR /&gt;
libname dta ODBC dsn="&amp;amp;DbDsn";&lt;BR /&gt;
&lt;BR /&gt;
The insert would look like this:&lt;BR /&gt;
insert into dta.ITGCostCurves .... select ...&lt;BR /&gt;
&lt;BR /&gt;
The "select" would be in SAS syntax. &lt;BR /&gt;
&lt;BR /&gt;
Hope this helps,&lt;BR /&gt;
&lt;BR /&gt;
Yoba

Message was edited by: yoba</description>
      <pubDate>Thu, 28 May 2009 18:24:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38169#M9759</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T18:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a SAS Dataset into a SQL database using passthrough</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38170#M9760</link>
      <description>Thank you.</description>
      <pubDate>Thu, 28 May 2009 18:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-a-SAS-Dataset-into-a-SQL-database-using-passthrough/m-p/38170#M9760</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T18:49:26Z</dc:date>
    </item>
  </channel>
</rss>

