<?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: Outputting SAS Dataset to be viewed in SQL in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4976#M2005</link>
    <description>Julrik,&lt;BR /&gt;
&lt;BR /&gt;
Try something like this, I believe you'll need SAS/Access for MS Sql Server to do this.  The libname has certain options and depending on how your system is set up you will have to make adjustments to fit your particular needs.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname sqlsrvr oledb provider=sqloledb properties=("data source"         ='DEV9\DEV9' "Database"        ='DEV9'  &lt;BR /&gt;
                                                    "Integrated Security" ='SSPI'      "initial catalog" ='master') &lt;BR /&gt;
                  schema=dbo BCP=YES BCP_ERRORFILE="Z:\error_out.txt"; &lt;BR /&gt;
&lt;BR /&gt;
data SAS_DATA_SET_NAME_HERE ;&lt;BR /&gt;
set datain;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql; &lt;BR /&gt;
   create table sqlsrvr.SQL_SERVER_TABLE_NAME_HERE as&lt;BR /&gt;
         select * from SAS_DATA_SET_NAME_HERE;&lt;BR /&gt;
quit;</description>
    <pubDate>Fri, 05 Oct 2007 23:21:48 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-10-05T23:21:48Z</dc:date>
    <item>
      <title>Outputting SAS Dataset to be viewed in SQL</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4974#M2003</link>
      <description>Hello, I am a new user and know only the basic functions of sas and was assigned a project to figure out how to output a SAS dataset to be viewed in MS SQL Server. I have the dataset created, all I need to know is how I can convert that to a table that SQL server is able to open. The best way I can find is exporting the dataset to a csv file and then writing code in SQL to import the CSV file. But seems like that is an extra step that shouldn't have to be taken and because of the 300+ columns in the dataset I don't want to have to define each one in the SQL code. Can anyone help? &lt;BR /&gt;
&lt;BR /&gt;
Sorry in advance if I posted in the wrong discussion group but this one sounded close to what I want to do.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Fri, 05 Oct 2007 19:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4974#M2003</guid>
      <dc:creator>julrik</dc:creator>
      <dc:date>2007-10-05T19:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting SAS Dataset to be viewed in SQL</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4975#M2004</link>
      <description>Hi,&lt;BR /&gt;
  This is not the right forum for this question. In fact, this is really a question that is best answered by Tech Support. To find out how to contact SAS Tech Support, refer to:&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/contact/index.html" target="_blank"&gt;http://support.sas.com/techsup/contact/index.html&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
and you might also find these previous forum postings and Tech Support Notes to be of interest:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=2624ੀ" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=2624ੀ&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=1946ޚ" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=1946ޚ&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=4121မ" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=4121မ&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/unotes/SN/006/006450.html" target="_blank"&gt;http://support.sas.com/techsup/unotes/SN/006/006450.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/unotes/SN/011/011332.html" target="_blank"&gt;http://support.sas.com/techsup/unotes/SN/011/011332.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/unotes/SN/009/009733.html" target="_blank"&gt;http://support.sas.com/techsup/unotes/SN/009/009733.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 05 Oct 2007 19:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4975#M2004</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-10-05T19:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting SAS Dataset to be viewed in SQL</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4976#M2005</link>
      <description>Julrik,&lt;BR /&gt;
&lt;BR /&gt;
Try something like this, I believe you'll need SAS/Access for MS Sql Server to do this.  The libname has certain options and depending on how your system is set up you will have to make adjustments to fit your particular needs.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname sqlsrvr oledb provider=sqloledb properties=("data source"         ='DEV9\DEV9' "Database"        ='DEV9'  &lt;BR /&gt;
                                                    "Integrated Security" ='SSPI'      "initial catalog" ='master') &lt;BR /&gt;
                  schema=dbo BCP=YES BCP_ERRORFILE="Z:\error_out.txt"; &lt;BR /&gt;
&lt;BR /&gt;
data SAS_DATA_SET_NAME_HERE ;&lt;BR /&gt;
set datain;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql; &lt;BR /&gt;
   create table sqlsrvr.SQL_SERVER_TABLE_NAME_HERE as&lt;BR /&gt;
         select * from SAS_DATA_SET_NAME_HERE;&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 05 Oct 2007 23:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-SAS-Dataset-to-be-viewed-in-SQL/m-p/4976#M2005</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-10-05T23:21:48Z</dc:date>
    </item>
  </channel>
</rss>

