<?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: how to covert character date to numeric date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-covert-character-date-to-numeric-date/m-p/877187#M346528</link>
    <description>&lt;P&gt;22/04/2023 in "numeric" form is twenty-two divided by four divided by two thousand and twenty-three and so has nothing to with a date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The number in your PICTURE looks to be 23,122 (twenty-three thousand one hundred and twenty-two).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want that number to PRINT as 22APR2023 then just print it using the DATE9. format.&lt;/P&gt;
&lt;PRE&gt;1591  data test;
1592   to_date=23122;
1593   put to_date date9.;
1594  run;

22APR2023
&lt;/PRE&gt;
&lt;P&gt;Try something like this to see the impact of using different formats to display the same number.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA mydata4;
  SET mydata3;
  from_date2=from_date;
  from_date3=from_date;
  from_date4=from_date;
  format from_date comma6. from_date2 ddmmyy10. from_date3 date9. from_date4 yymmdd10.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS Displaying dates in either DMY or MDY order will confuse half of your audience.&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 02:40:17 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-05-24T02:40:17Z</dc:date>
    <item>
      <title>how to covert character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-covert-character-date-to-numeric-date/m-p/877186#M346527</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking for the way to convert character date value to numeric date value&amp;nbsp;like below shown&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84232i1C6477CA6DB89B97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What I wanted is to have TO_DATE from 22/04/2023 in numeric form transferred to 22APR2023 in numeric form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is my code attempt to do so but failed. any suggestion would you advice to me?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA mydata4;&lt;BR /&gt;SET mydata3;&lt;/P&gt;
&lt;P&gt;FROM_DATE2=input(FROM_DATE,DDMMYY10.); &lt;BR /&gt;TO_DATE2=input(TO_DATE,DDMMYY10.);&lt;/P&gt;
&lt;P&gt;FROM_DATE3=put(FROM_DATE2,DATE9.);&lt;BR /&gt;TO_DATE3=put(TO_DATE2,DATE9.);&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards,&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 01:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-covert-character-date-to-numeric-date/m-p/877186#M346527</guid>
      <dc:creator>harrylui</dc:creator>
      <dc:date>2023-05-24T01:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to covert character date to numeric date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-covert-character-date-to-numeric-date/m-p/877187#M346528</link>
      <description>&lt;P&gt;22/04/2023 in "numeric" form is twenty-two divided by four divided by two thousand and twenty-three and so has nothing to with a date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The number in your PICTURE looks to be 23,122 (twenty-three thousand one hundred and twenty-two).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want that number to PRINT as 22APR2023 then just print it using the DATE9. format.&lt;/P&gt;
&lt;PRE&gt;1591  data test;
1592   to_date=23122;
1593   put to_date date9.;
1594  run;

22APR2023
&lt;/PRE&gt;
&lt;P&gt;Try something like this to see the impact of using different formats to display the same number.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA mydata4;
  SET mydata3;
  from_date2=from_date;
  from_date3=from_date;
  from_date4=from_date;
  format from_date comma6. from_date2 ddmmyy10. from_date3 date9. from_date4 yymmdd10.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS Displaying dates in either DMY or MDY order will confuse half of your audience.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 02:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-covert-character-date-to-numeric-date/m-p/877187#M346528</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-24T02:40:17Z</dc:date>
    </item>
  </channel>
</rss>

