<?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 Loading data from SAS to Teradata in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294720#M270211</link>
    <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me explain you what is my little problem. I have a SAS data set with 3 columns with Numerical format (Numeric Length 8), and I would like to insert them into a Teradata table with 3 columns with the next formats: Decimal(11,3), Integer, Decimal(11,3). Nonetheless I receive a ROLLBACK error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: I have enough permissions in the teradata library and I have a good conectivity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS code I am using is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;insert into tdt.table_1&lt;/P&gt;&lt;P&gt;select C_1 format=BEST11.3,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_2 format=BEST11,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_3 format=BEST11.3&lt;/P&gt;&lt;P&gt;from lib.table_2;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, can anybody explain me how to change formats in order to move data from SAS into Teradata?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I have been reading the SAS Support link for Teradata formats, but I couldn't achieve the solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/69039/HTML/default/viewer.htm#n0v7nh4ylrihtin1te8xl0q3dvzv.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/69039/HTML/default/viewer.htm#n0v7nh4ylrihtin1te8xl0q3dvzv.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advanced!&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2016 08:10:34 GMT</pubDate>
    <dc:creator>Gcruzg</dc:creator>
    <dc:date>2016-08-29T08:10:34Z</dc:date>
    <item>
      <title>Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294720#M270211</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me explain you what is my little problem. I have a SAS data set with 3 columns with Numerical format (Numeric Length 8), and I would like to insert them into a Teradata table with 3 columns with the next formats: Decimal(11,3), Integer, Decimal(11,3). Nonetheless I receive a ROLLBACK error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: I have enough permissions in the teradata library and I have a good conectivity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS code I am using is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;insert into tdt.table_1&lt;/P&gt;&lt;P&gt;select C_1 format=BEST11.3,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_2 format=BEST11,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C_3 format=BEST11.3&lt;/P&gt;&lt;P&gt;from lib.table_2;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, can anybody explain me how to change formats in order to move data from SAS into Teradata?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I have been reading the SAS Support link for Teradata formats, but I couldn't achieve the solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/69039/HTML/default/viewer.htm#n0v7nh4ylrihtin1te8xl0q3dvzv.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/69039/HTML/default/viewer.htm#n0v7nh4ylrihtin1te8xl0q3dvzv.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advanced!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 08:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294720#M270211</guid>
      <dc:creator>Gcruzg</dc:creator>
      <dc:date>2016-08-29T08:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294724#M270212</link>
      <description>&lt;P&gt;A number is a number is a number in SAS, meaning it is always stored as a 64 bit real number.&lt;/P&gt;
&lt;P&gt;The formats have no effect on storage.&lt;/P&gt;
&lt;P&gt;I guess you are better off creating a new table from SAS in Teradata and handling the insert from that table in Teradata, using explicit pass-through.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 08:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294724#M270212</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-29T08:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294727#M270213</link>
      <description>&lt;P&gt;PS my preferred method for transfers back to the production database is to create a text file (usually fixed-width columns) and let the DBA people make the import.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 08:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294727#M270213</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-29T08:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294741#M270214</link>
      <description>&lt;PRE&gt;
Those formats are belong to Teradata. So you need create a table with these format
at Teradata side and load SAS dataset into Teradata ,then use INSERT by Pass-through
OR just try:
proc append base=x data=have;run;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Aug 2016 10:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294741#M270214</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-29T10:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294781#M270215</link>
      <description>&lt;P&gt;The formats specified in an insert statement&amp;nbsp;should have no affect to the actual&amp;nbsp;data flow. So you need&amp;nbsp;to make sure that your actual data values in SAS matches the expected data type in Teradata. You may need to to truncate/round to create integers as an example.&lt;/P&gt;
&lt;P&gt;You can specify formats in SAS to control data types and length&amp;nbsp;in Teradata, but only during table creation. And again, it does not affect the physical data format comming from SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 12:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294781#M270215</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-29T12:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294783#M270216</link>
      <description>&lt;P&gt;I know what you mean.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The point is that the table's skeleton is already created on Teradata, so I cannot change the formats in it. That's why I need to know how to convert the sas formats into others to move them to Teradata tables.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 12:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294783#M270216</guid>
      <dc:creator>Gcruzg</dc:creator>
      <dc:date>2016-08-29T12:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294794#M270217</link>
      <description>&lt;P&gt;Look what SAS types are created if you import the table into sas:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table_1;
set tdt.table_1 (obs=1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This might give you a clue how your SAS data should be structured.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 13:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294794#M270217</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-29T13:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294796#M270218</link>
      <description>&lt;P&gt;As said, you need&amp;nbsp;to use SAS function to truncate/round your values, so they match the Teradata data types/precision.&lt;/P&gt;
&lt;P&gt;Take a look at ROUND, CEIL, FLOOR...&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 13:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/294796#M270218</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-29T13:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/295031#M270219</link>
      <description>&lt;PRE&gt;
Could you try DBTYPE options ?

data teradata.temp(dbtype=(a='Decimal(11,3)' b='char(20)'));
 set sas.have;
run;


&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Aug 2016 02:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/295031#M270219</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-30T02:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from SAS to Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/296467#M270220</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, with some of your advices, finally I solved the problem. Here it goes the solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I defined the library with a libname statement using the following options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;liname tera teradata user=xxx passwrod=xxx server=xxxx schema=xxxx sql_options=all mode=teradata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The, in the insert-into sql sentences i used the option (fastload=yes), as the following example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;insert into tera.table_1 (fastload=yes)&lt;/P&gt;&lt;P&gt;select * from lib.table2;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again, thank you so much for your advices and I hope that my solution will help you someday.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 08:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loading-data-from-SAS-to-Teradata/m-p/296467#M270220</guid>
      <dc:creator>Gcruzg</dc:creator>
      <dc:date>2016-09-05T08:08:01Z</dc:date>
    </item>
  </channel>
</rss>

