<?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 convert date to  different format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824747#M325729</link>
    <description>&lt;P&gt;How would I convert date from:&lt;/P&gt;
&lt;P&gt;11OCT1936 to 10/11/1936&amp;nbsp; OR&amp;nbsp; to 10-11-1936?&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>Thu, 21 Jul 2022 18:52:15 GMT</pubDate>
    <dc:creator>bhca60</dc:creator>
    <dc:date>2022-07-21T18:52:15Z</dc:date>
    <item>
      <title>convert date to  different format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824747#M325729</link>
      <description>&lt;P&gt;How would I convert date from:&lt;/P&gt;
&lt;P&gt;11OCT1936 to 10/11/1936&amp;nbsp; OR&amp;nbsp; to 10-11-1936?&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>Thu, 21 Jul 2022 18:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824747#M325729</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-07-21T18:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: convert date to  different format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824749#M325730</link>
      <description>&lt;P&gt;Assign a different format. MMDDYY10. or MMDDYYD10.&lt;/P&gt;
&lt;P&gt;But I recommend the ISO 8601 compatible YYMMDD10.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 19:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824749#M325730</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-21T19:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: convert date to  different format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824792#M325762</link>
      <description>&lt;P&gt;What is the current format of the variable? If it is DATE9. then you only need to change the format.&lt;/P&gt;
&lt;P&gt;10/11/1936 would be mmddyy10.&lt;/P&gt;
&lt;P&gt;10-11-1936 would be mmddyyd10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the value is character, i.e. a format like $9. , you would likely be better off by creating a new variable as a date value with code like&lt;/P&gt;
&lt;P&gt;Newdate= input(date,date9.);&lt;/P&gt;
&lt;P&gt;and assign a desired format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you haven't work much with dates the ability to create different summaries just by changing the format is a very powerful tool. Use a YEAR format and the summary using that date would summarize by year.&lt;/P&gt;
&lt;P&gt;For example this uses a SAS supplied set you can test code with that summarizes by calendar year getting the lowest Low price, the maximum high price and the total sales volume from the dates in the data:&lt;/P&gt;
&lt;PRE&gt;Proc tabulate data=sashelp.stocks;
   class stock  date;
   format date year4.;
   var high low volume;
   table stock*date,
         low*min='' high*max='' volume*sum=' '
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Changing the format from Year4 to YYQ6 creates calendar quarter summaries. Using MONNAME. will create month summaries across the years, i.e. January for all the years in the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 21:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-date-to-different-format/m-p/824792#M325762</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-07-21T21:54:35Z</dc:date>
    </item>
  </channel>
</rss>

