<?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: SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462883#M117876</link>
    <description>&lt;P&gt;Oh sorry I misread. You want 2&amp;nbsp; columns in a new data base table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then this should work no?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; drop table VMART.TESTSAS; quit;

proc append base=VMART.TESTSAS data=DATADIR.APPTEST(keep=ID_EVNT ID_APPTEST); run;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 22:08:13 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-05-16T22:08:13Z</dc:date>
    <item>
      <title>SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462525#M117774</link>
      <description>&lt;P&gt;I am testing the SAS/Access to Vertica Interface. I would like to know if there is a way to INSERT data into a Vertica table, from a SAS dataset, using the SQL pass-through facility or the LIBNAME option?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my program,&lt;/P&gt;&lt;P&gt;&amp;nbsp;- I have a SAS dataset stored on disk&lt;/P&gt;&lt;P&gt;&amp;nbsp;- I would like to read that dataset and insert all the data into a table in Vertica&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can this be done? I would like SAS to create the table and insert all the rows. Do I have to pre-define the table definition or can SAS create it knowing Vertica data types and syntax? Is this even possible cause I haven't found any examples that do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any support or pointers to code examples will be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2018 22:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462525#M117774</guid>
      <dc:creator>arpanshah</dc:creator>
      <dc:date>2018-05-15T22:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462542#M117776</link>
      <description>&lt;P&gt;I don't know Vertica, but assuming it is similar to other databases, standard SAS code should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data VERTLIB.TAB;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set SASLIB. TAB;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc copy should also work (and is preferable).&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 02:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462542#M117776</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-05-16T02:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462543#M117777</link>
      <description>Or PROC APPEND.&lt;BR /&gt;Or SQL INSERT INTO.&lt;BR /&gt;Or...etc</description>
      <pubDate>Wed, 16 May 2018 02:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462543#M117777</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-05-16T02:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462853#M117867</link>
      <description>&lt;P&gt;Thanks, but I will try to better articulate my problem here with code. I apologize but I am a beginner SAS developer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the simple SAS CODE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname datadir "~/data";&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;connect to vertica as vmart ( server="&amp;amp;rmtsrv" port=5433 database=verpoc user="&amp;amp;rmtuser" password="&amp;amp;rmtpw" INSERT_SQL=YES );&lt;BR /&gt;create table datadir.apptest&amp;nbsp;as&lt;BR /&gt;select * from connection to vmart (select * from poc.apptest where extract (year from dttm_val) &amp;gt; 1582 limit 100);&lt;/P&gt;&lt;P&gt;disconnect from vmart;&lt;/P&gt;&lt;P&gt;***The above code created a sas dataset called apptest.sas7bdat in the data directory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***I would now like to insert 2 columns from the apptest.sas7bdat into a new testsas table in the database.&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;connect to vertica as vmart ( server="&amp;amp;rmtsrv" port=5433 database=verpoc user="&amp;amp;rmtuser" password="&amp;amp;rmtpw" INSERT_SQL=YES );&lt;BR /&gt;select * from connection to vmart (insert into poc.testsas &lt;FONT color="#FF0000"&gt;select id_evnt,id_apptest from datadir.apptest&lt;/FONT&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I cannot do what is highlighted in red because it executes on Vertica and that datadir.apptest is not valid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how I can Read rows from apptest.sas7bdat and insert them into Vertica and potentially insert the full sas apptest.sas7bdat dataset, after manipulation, back into Vertica. What is the right SQL pass-through syntax or alternative way to run the insert? Is there any bulk insert supported from the script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462853#M117867</guid>
      <dc:creator>arpanshah</dc:creator>
      <dc:date>2018-05-16T21:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462868#M117870</link>
      <description>&lt;P&gt;You must do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;libname VMART&lt;SPAN&gt;&amp;nbsp;vertica server="&amp;amp;rmtsrv" port=5433 database=verpoc user="&amp;amp;rmtuser" password="&amp;amp;rmtpw" INSERT_SQL=YES ;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;proc append data=VMART.TESTSAS append=DATADIR.APPTEST;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462868#M117870</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-05-16T21:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Access to Vertica - Insert from SAS Dataset using SQL pass-through facility</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462883#M117876</link>
      <description>&lt;P&gt;Oh sorry I misread. You want 2&amp;nbsp; columns in a new data base table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then this should work no?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; drop table VMART.TESTSAS; quit;

proc append base=VMART.TESTSAS data=DATADIR.APPTEST(keep=ID_EVNT ID_APPTEST); run;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 22:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Access-to-Vertica-Insert-from-SAS-Dataset-using-SQL-pass/m-p/462883#M117876</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-05-16T22:08:13Z</dc:date>
    </item>
  </channel>
</rss>

