<?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: $ATE9  format char in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788743#M252268</link>
    <description>&lt;P&gt;It is much more important to check the &lt;STRONG&gt;TYPE&lt;/STRONG&gt;&amp;nbsp;(and the LENGTH for character variables) than any FORMAT or INFORMAT that might (or might not) be attached to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If looks like your variable is of type CHAR and should have a length of 10 (not 9) to be able to store date strings with four digit years and hyphens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use SAS code you can remove the format attached to variable which will make it easier to see what actual data is stored in the field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if your current dataset is named HAVE and the variable in question is named DATE then this code will make a new dataset named WANT with the format removed from the variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
   format date ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Jan 2022 21:49:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-01-06T21:49:37Z</dc:date>
    <item>
      <title>$ATE9  format char</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788736#M252262</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I need to work with a data set with a date field in chat format .&lt;/P&gt;
&lt;P&gt;The format is&amp;nbsp; $ATE9&amp;nbsp; and the informat is same $ATE9&lt;/P&gt;
&lt;P&gt;Fr exampe: the date value looks like this&amp;nbsp;&amp;nbsp;2020-12-2&lt;/P&gt;
&lt;P&gt;My question: What is the format $ATE9?&lt;/P&gt;
&lt;P&gt;How can I convert it to SAS date??&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 20:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788736#M252262</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-06T20:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: $ATE9  format char</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788737#M252263</link>
      <description>&lt;P&gt;The is no built-in format $ATE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It must be a custom format, or a format created and saved by someone else. Look in your program to see if that is the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use this option to ignore the format and apply your own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nofmterr;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jan 2022 21:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788737#M252263</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-06T21:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: $ATE9  format char</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788738#M252264</link>
      <description>&lt;P&gt;Thanks:&lt;/P&gt;
&lt;P&gt;So as I understand I need to write the following code and then the format is going out from the variable?&lt;/P&gt;
&lt;P&gt;Will informat also go out?&lt;/P&gt;
&lt;P&gt;(Remind that both format and informat are $ATE9 (As i understand it is user defined )&lt;/P&gt;
&lt;P&gt;What is the way to return to&amp;nbsp; default status after the proc sql?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nofmterr;
proc sql;
create table as want
select  date
from have
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jan 2022 21:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788738#M252264</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-06T21:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: $ATE9  format char</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788740#M252265</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks:&lt;/P&gt;
&lt;P&gt;So as I understand I need to write the following code and then the format is going out from the variable?&lt;/P&gt;
&lt;P&gt;Will informat also go out?&lt;/P&gt;
&lt;P&gt;(Remind that both format and informat are $ATE9 (As i understand it is user defined )&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please give it a try and let us know what happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to return to&amp;nbsp; default status after the proc sql?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nofmterr;
proc sql;
create table as want
select  date
from have
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;options fmterr;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;By the way, informats are irrelevant to SQL.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 21:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788740#M252265</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-06T21:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: $ATE9  format char</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788743#M252268</link>
      <description>&lt;P&gt;It is much more important to check the &lt;STRONG&gt;TYPE&lt;/STRONG&gt;&amp;nbsp;(and the LENGTH for character variables) than any FORMAT or INFORMAT that might (or might not) be attached to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If looks like your variable is of type CHAR and should have a length of 10 (not 9) to be able to store date strings with four digit years and hyphens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use SAS code you can remove the format attached to variable which will make it easier to see what actual data is stored in the field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if your current dataset is named HAVE and the variable in question is named DATE then this code will make a new dataset named WANT with the format removed from the variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
   format date ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jan 2022 21:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788743#M252268</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-06T21:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: $ATE9  format char</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788751#M252274</link>
      <description>&lt;P&gt;If you run this code and examine the resulting format for the variable X you may be able to deduce a likely cause.&lt;/P&gt;
&lt;PRE&gt;data example;
   x='2021-12-2';
   format x date9.;
run;

proc contents data=example;
run;&lt;/PRE&gt;
&lt;P&gt;For those not interested in actually running the code you can see the "format" that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt; has in his data. No custom format just the way SAS will report this particular incorrect attempt at assigning an existing format.&lt;/P&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;A name="IDX3" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Variables" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" colspan="5" scope="colgroup"&gt;Alphabetic List of Variables and Attributes&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Len&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Format&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;x&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;9&lt;/TD&gt;
&lt;TD class="l data"&gt;$ATE9.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ATE9-format-char/m-p/788751#M252274</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-06T23:03:34Z</dc:date>
    </item>
  </channel>
</rss>

