<?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: Load Sas to Netezza with specifying data types in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514467#M15989</link>
    <description>&lt;P&gt;ok&amp;nbsp;if that is the case, please use dbtype as shown. if it is possible&amp;nbsp; make a SAS dataset with 5 or ten records and then try something like shown below. if it works then apply it to large dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nztable.cust_table (dbtype=(cust_value='integer'
 cust_n='char(1)'));
set work.cust_table;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Nov 2018 15:19:01 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2018-11-19T15:19:01Z</dc:date>
    <item>
      <title>Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/513913#M15979</link>
      <description>&lt;P&gt;When I load SAS files to Netezza, SAS chooses it's own data types which will affect the performance in Netezza when querying through a really large table because sometimes I can store a column as a BYTEINT in Netezza but when importing it from SAS, it'll store it as Character Varying (1). So instead I tried to create the table in Aginity and than insert the SAS file into the table through SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code to import SAS to Netezza:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME ECLIB000 "\\Path\To\SASTables";
libname sdf odbc noprompt="server=xxxx; DRIVER={NetezzaSQL}; port=xxxx; database=xxx; username=xxxx; password=xxxx;";


proc sql;
INSERT INTO sdf.NetezzaTable
(bulkload=YES)
SELECT * FROM ECLIB000.SASTable;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With doing this, I get errors like: &lt;STRONG&gt;ERROR: Value 2 on the SELECT clause does not match the data type of the corresponding column listed after the INSERT table name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And I'm guessing it's because it's trying to insert a value that has a different data type than the one I created. How can I insert into the Netezza table using the data types I created in Aginity? Or is there a better way to doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 15:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/513913#M15979</guid>
      <dc:creator>jim_toby</dc:creator>
      <dc:date>2018-11-16T15:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514003#M15981</link>
      <description>&lt;P&gt;if you have SAS dataset with number and you can map it to byteint.&lt;/P&gt;
&lt;P&gt;As said previously post SAS is pretty smart in mapping most of time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS numeric can be mapped to byteint int decimal easily and it takes care of its own&lt;/P&gt;
&lt;P&gt;SAS charcter to char varchar etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure, what exactly issue your having.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try using dbsastype as shown in below example . info on dbsastype in the link&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371572.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371572.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc append base=dblib.hrdata (dbsastype=(empid='CHAR(20)'))
            data=saslib.personnel;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Nov 2018 17:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514003#M15981</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-11-16T17:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514010#M15982</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;does this append to a table in SAS or in Netezza. I want to insert data into an existing table in netezza. In the link you sent it seems like the proc append is used to insert in a SAS table.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 18:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514010#M15982</guid>
      <dc:creator>jim_toby</dc:creator>
      <dc:date>2018-11-16T18:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514031#M15983</link>
      <description>&lt;P&gt;this is appending to netezza table. your base table is netezza table&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 19:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514031#M15983</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-11-16T19:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514444#M15986</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;thanks, it seems like it's appending but I'm still having issues with the data type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing what you suggested but when I run:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select * from _v_relation_column where name = 'hrdata'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I still see that the data types under the FORMAT_TYPE column are either double precision or character varying. I defined them as either integer, char(1) or DEC(18, 10). Here is my SAS code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME SASLIB "\Path\To\SASTable";
LIBNAME ntza odbc noprompt "server=xxxx; port=xxxx, ....";

proc append base= ntza.hrdata (dbsastype= (col1= 'INTEGER' col2= 'CHAR(1)' col3= 'DEC(18, 10) col4= 'INTEGER'))
data= SASLIB.SasTable
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Also, when appending to Netezza, can you use the bulkload option?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514444#M15986</guid>
      <dc:creator>jim_toby</dc:creator>
      <dc:date>2018-11-19T14:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514462#M15987</link>
      <description>&lt;P&gt;is your Netezza table,&amp;nbsp; newly created table or you are appending the data to already created netezza table(Just for information, Proc append will create table, if same name table is not there). if it is already created table, you cannot change datatype. for changing datatypes will have multiple restrictions, most often you have to recreate netezza table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514462#M15987</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-11-19T14:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514463#M15988</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;no, my Netezza table isn't created before hand. I let the proc append create the table but for example it still changes all of the integers to be double precision.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514463#M15988</guid>
      <dc:creator>jim_toby</dc:creator>
      <dc:date>2018-11-19T14:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Load Sas to Netezza with specifying data types</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514467#M15989</link>
      <description>&lt;P&gt;ok&amp;nbsp;if that is the case, please use dbtype as shown. if it is possible&amp;nbsp; make a SAS dataset with 5 or ten records and then try something like shown below. if it works then apply it to large dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nztable.cust_table (dbtype=(cust_value='integer'
 cust_n='char(1)'));
set work.cust_table;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Nov 2018 15:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Load-Sas-to-Netezza-with-specifying-data-types/m-p/514467#M15989</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-11-19T15:19:01Z</dc:date>
    </item>
  </channel>
</rss>

