<?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: Date conversion from string using date9. got same number from different year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727156#M226099</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/374318"&gt;@tinaz5012&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=p106m1k307c61in1hyfymetc7uh3.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;&lt;FONT face="courier new,courier"&gt;date&lt;STRONG&gt;9&lt;/STRONG&gt;.&lt;/FONT&gt; informat&lt;/A&gt; reads only the first 9 characters of the strings dt1, dt2, dt3, e.g., "&lt;STRONG&gt;05/DEC/20&lt;/STRONG&gt;&lt;FONT color="#999999"&gt;19&lt;/FONT&gt;" (i.e., 5th December 20&lt;STRONG&gt;20&lt;/STRONG&gt;). Use the &lt;FONT face="courier new,courier"&gt;date&lt;EM&gt;11&lt;/EM&gt;.&lt;/FONT&gt; informat to read all 11 characters.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 16:13:52 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-03-17T16:13:52Z</dc:date>
    <item>
      <title>Date conversion from string using date9. got same number from different year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727148#M226092</link>
      <description>&lt;P&gt;I am testing on conversion of string to date with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%sysmstoreclear;&lt;/P&gt;&lt;P&gt;data test2;&lt;BR /&gt;dt1="05/DEC/2019";&lt;BR /&gt;dt2="30/SEP/2020";&lt;BR /&gt;dt3="05/dec/2020";&lt;BR /&gt;num1=input(dt1,date9.);&lt;BR /&gt;num2=input(dt2,date9.);&lt;BR /&gt;num3=input(dt3,date9.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result is shown in the below picture, num1 and num3 have same value. Can anyone please advise what is the reason caused this?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date9.jpg" style="width: 807px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56063iD1539505C5BCD1A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="date9.jpg" alt="date9.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 15:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727148#M226092</guid>
      <dc:creator>tinaz5012</dc:creator>
      <dc:date>2021-03-17T15:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion from string using date9. got same number from different year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727156#M226099</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/374318"&gt;@tinaz5012&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=p106m1k307c61in1hyfymetc7uh3.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;&lt;FONT face="courier new,courier"&gt;date&lt;STRONG&gt;9&lt;/STRONG&gt;.&lt;/FONT&gt; informat&lt;/A&gt; reads only the first 9 characters of the strings dt1, dt2, dt3, e.g., "&lt;STRONG&gt;05/DEC/20&lt;/STRONG&gt;&lt;FONT color="#999999"&gt;19&lt;/FONT&gt;" (i.e., 5th December 20&lt;STRONG&gt;20&lt;/STRONG&gt;). Use the &lt;FONT face="courier new,courier"&gt;date&lt;EM&gt;11&lt;/EM&gt;.&lt;/FONT&gt; informat to read all 11 characters.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 16:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727156#M226099</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-03-17T16:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion from string using date9. got same number from different year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727158#M226101</link>
      <description>That isn't a date9 format so it's getting garbled, date9 doesn't have separators. So SAS is reading only the 20 portion, the fact that the last two work correctly is just a coincidence. &lt;BR /&gt;&lt;BR /&gt;Date11 will work fine.</description>
      <pubDate>Wed, 17 Mar 2021 16:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727158#M226101</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-17T16:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion from string using date9. got same number from different year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727189#M226115</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
  dt1="05/DEC/2019";
  dt2="30/SEP/2020";
  dt3="05/dec/2020";&lt;BR /&gt;  dt4="30/SEP/2021";
  num1=input(dt1,date11.);
  num2=input(dt2,date11.);
  num3=input(dt3,date11.);
  Num4=input(dt4,date11.);
  format num1 num2 num3 num4 MONYY.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the date9 format. take only the first nine numbers of the date to get them all use the date11., according to the code below I used Format to debug and show that date11. really is it works.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 17:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727189#M226115</guid>
      <dc:creator>juanormelli</dc:creator>
      <dc:date>2021-03-17T17:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion from string using date9. got same number from different year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727194#M226116</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28248"&gt;@ree&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/362620"&gt;@juanormelli&lt;/a&gt;&amp;nbsp; Thank you all for kindly help, appreciate it!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 17:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-conversion-from-string-using-date9-got-same-number-from/m-p/727194#M226116</guid>
      <dc:creator>tinaz5012</dc:creator>
      <dc:date>2021-03-17T17:20:09Z</dc:date>
    </item>
  </channel>
</rss>

