<?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: Difficulty saving user defined format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520365#M141083</link>
    <description>&lt;P&gt;What did you expect SAS to do in that situation?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you attach a format to a variable is SAS it just stores the format specification (ie:&amp;nbsp; 'COMMA10.2' ) into the metadata of the dataset. There is no place in Teradata to store that and Teradata wouldn't know what it meant anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use the formats with the table in SAS then just make sure to re-attach the format with a FORMAT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mydb teradata .... ;
proc print mydb.mytable;
  format myvar myfmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise use the format to generate a new character variable withe the decoded value of the variable and store that in Teradata.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydb.mytable;
  set mysas.mytable;
  var1_decode = put(var1,fmt.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Dec 2018 14:01:45 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-12-11T14:01:45Z</dc:date>
    <item>
      <title>Difficulty saving user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520344#M141074</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recently created a user-defined format which I have used in formatting&amp;nbsp;a variable&amp;nbsp;on my table. The format works well on temporary tables&amp;nbsp;and reformats the values as needed, but when I try to save the table&amp;nbsp;with formatted values&amp;nbsp;to our Teradata database&amp;nbsp;it strips out the formats and saves values unformatted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if anyone knows why this is happening or how to address it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 13:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520344#M141074</guid>
      <dc:creator>frupaul</dc:creator>
      <dc:date>2018-12-11T13:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty saving user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520351#M141078</link>
      <description>&lt;P&gt;Have you tried any of the topis which come up from a Google search?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/sgf09/338-2009.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/sgf09/338-2009.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/indbug/68170/HTML/default/viewer.htm#p10m7bigg3hsgbn1f6v5tzjxcyl8.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/indbug/68170/HTML/default/viewer.htm#p10m7bigg3hsgbn1f6v5tzjxcyl8.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003276900.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003276900.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally I avoid having formats for any data which is not stored only as SAS data - i.e. CSV, databases, transfer files etc. I would always put the full values.&amp;nbsp; But then I am really not a fan of proprietary binary file formats at all.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 13:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520351#M141078</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-11T13:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty saving user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520365#M141083</link>
      <description>&lt;P&gt;What did you expect SAS to do in that situation?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you attach a format to a variable is SAS it just stores the format specification (ie:&amp;nbsp; 'COMMA10.2' ) into the metadata of the dataset. There is no place in Teradata to store that and Teradata wouldn't know what it meant anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use the formats with the table in SAS then just make sure to re-attach the format with a FORMAT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mydb teradata .... ;
proc print mydb.mytable;
  format myvar myfmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise use the format to generate a new character variable withe the decoded value of the variable and store that in Teradata.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydb.mytable;
  set mysas.mytable;
  var1_decode = put(var1,fmt.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Dec 2018 14:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difficulty-saving-user-defined-format/m-p/520365#M141083</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-11T14:01:45Z</dc:date>
    </item>
  </channel>
</rss>

