<?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 Formats installed in Teradata in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Formats-installed-in-Teradata/m-p/238273#M6162</link>
    <description>&lt;P&gt;Great if it works, even if a NUM column in SAS would be preferred.&lt;/P&gt;
&lt;P&gt;But don't you have a test environment for Teradata, where you could convince your DBAs to install SAS formats - that shouldn't be too hard...?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2015 14:21:10 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2015-12-08T14:21:10Z</dc:date>
    <item>
      <title>SAS Formats installed in Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Formats-installed-in-Teradata/m-p/238114#M6156</link>
      <description>&lt;P&gt;Do you have SAS/Access to Teradata, plus SAS formats installed in Teradata?&amp;nbsp; I have a possible solution to the problem of viewing or analyzing BIGINT and very large (or very small) decimal values.&amp;nbsp; But we don't have SAS formats installed in Teradata, so I cannot test my solution.&amp;nbsp; If this works, then I can convince our admin and DBAs to permit this change in Teradata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The basic idea is this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Install SAS formats in Teradata,&lt;/LI&gt;
&lt;LI&gt;Create SAS views using the libname access methode for your Teradata database.&lt;/LI&gt;
&lt;LI&gt;Format data in those SAS views to Teradata data, based upon data ranges for big decimal columns.&lt;/LI&gt;
&lt;LI&gt;I have published queries to find large decimal columns in Teradata, and compute the data ranges.&lt;/LI&gt;
&lt;LI&gt;Run those SAS views with the trace optioins turned on.&lt;/LI&gt;
&lt;LI&gt;The SAS views should make a request to Teradata to cast the columns.&lt;/LI&gt;
&lt;LI&gt;Voila!&amp;nbsp; Now your BIGINT and large (or small) decimal columns will appear in those SAS views.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Please let me know if you have SAS formats in Teradata, and I will write the code for the test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did my research, and was lucky enough to find code where Teradata does the cast, so I am theoretically confident in a positive result that will end the headache of BIGINT, etc.&amp;nbsp; Here is the reference (and proof) in the SAS support site:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; After SAS formats are installed on Teradata, we should be able to create SAS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; views to access Teradata tables without having any issues reading BIGINT or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; large DECIMAL values.&amp;nbsp; Of course, I plan to check those large numeric&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns to make sure they are in the data range of 15 decimal digits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A SAS document reference and programming example is &lt;A title="Casting in Teradata from a SAS view" href="https://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003276900.htm" target="_self"&gt;here&lt;/A&gt;, or you can paste this URL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="https://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003276900.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003276900.htm&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you scroll down a ways, you can see the SAS trace for a put() command, which casts that column:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS Code: &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT(PRICE,Dollar8.2) AS PRICE_C&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS trace for Teradata code:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TERADATA_2: Executed: on connection 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct cast(sas_put("sas"."mailorderdemo"."PRICE", 'DOLLAR8.2') &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as char(8)) as "PRICE_C" from "sas"."mailorderdemo"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 17:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Formats-installed-in-Teradata/m-p/238114#M6156</guid>
      <dc:creator>RedPlanet</dc:creator>
      <dc:date>2015-12-07T17:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Formats installed in Teradata</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Formats-installed-in-Teradata/m-p/238273#M6162</link>
      <description>&lt;P&gt;Great if it works, even if a NUM column in SAS would be preferred.&lt;/P&gt;
&lt;P&gt;But don't you have a test environment for Teradata, where you could convince your DBAs to install SAS formats - that shouldn't be too hard...?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 14:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Formats-installed-in-Teradata/m-p/238273#M6162</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-12-08T14:21:10Z</dc:date>
    </item>
  </channel>
</rss>

