<?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: Not all string dates converting to date format in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768111#M39548</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = input(dob, mmddyy10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look very very carefully. This is not the right informat to use with your data. Can you figure out why? The proper informat is ... well, after you identify why that informat isn't correct to use on your data, I leave that to you to figure out the correct informat as a homework assignment.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 13:54:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-09-16T13:54:27Z</dc:date>
    <item>
      <title>Not all string dates converting to date format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768103#M39547</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a column with all strings in a date format such as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;28/08/1969&lt;BR /&gt;19/04/1977&lt;BR /&gt;26/07/1956&lt;BR /&gt;26/06/1992&lt;BR /&gt;11/04/1984&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outputdata;
set inputdata ;
newvar = input(dob, mmddyy10.);
format newvar  mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I use the following code only some of the strings get converted to an actual SAS date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;28/08/1969 .&lt;BR /&gt;19/04/1977 .&lt;BR /&gt;26/07/1956 .&lt;BR /&gt;26/06/1992 .&lt;BR /&gt;11/04/1984 11/04/1984&lt;/P&gt;&lt;P&gt;Does anyone know why SAS is converting some of them but not others?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 12:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768103#M39547</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2021-09-16T12:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Not all string dates converting to date format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768111#M39548</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = input(dob, mmddyy10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look very very carefully. This is not the right informat to use with your data. Can you figure out why? The proper informat is ... well, after you identify why that informat isn't correct to use on your data, I leave that to you to figure out the correct informat as a homework assignment.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 13:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768111#M39548</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-16T13:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not all string dates converting to date format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768126#M39549</link>
      <description>Hi:&lt;BR /&gt;  Let's take a look at your data -- 28/08/1969 -- there's not a month 28, there could be a day 28. So when you are using the mmddyy10. informat in your INPUT function, you are asking SAS to use 28 as the month. This is just for the first day you show. Looking at the other samples, there's not a month 19 or a month 26 either. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; gave you a hint that you picked the wrong informat. If you experiment with different informats, you should find one that works.&lt;BR /&gt;  If you look in your SAS log you should have seen a NOTE similar to this:&lt;BR /&gt;NOTE: Invalid argument to function INPUT at line ?? column ??&lt;BR /&gt;&lt;BR /&gt;  This NOTE means that something was wrong with one of the arguments and since DOB was your character variable, the only other thing that could be wrong was your specification of mmddyy10. as the informat.&lt;BR /&gt;Cynthia&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Sep 2021 13:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Not-all-string-dates-converting-to-date-format/m-p/768126#M39549</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-09-16T13:25:16Z</dc:date>
    </item>
  </channel>
</rss>

