<?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 get month as a string from date in the format 'mm' in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392082#M94266</link>
    <description>You my friend, are a legend.&lt;BR /&gt;This appears to do exactly what I need!</description>
    <pubDate>Thu, 31 Aug 2017 04:41:35 GMT</pubDate>
    <dc:creator>bradja</dc:creator>
    <dc:date>2017-08-31T04:41:35Z</dc:date>
    <item>
      <title>How to get month as a string from date in the format 'mm'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392080#M94264</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm relatively new to SAS programming having had experience with MSSQL, MySQL mostly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the month as a string from a date in the format 'mm'.&lt;/P&gt;&lt;P&gt;For example: 01JAN2017 would result in '01'. 01FEB2017 would result in '02' etc.&lt;/P&gt;&lt;P&gt;I need the preceding 0 for months 1-9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been looking at PUT function(?) to do this but cannot find a format that is going to do what I need it to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any solution or ideas to point me in the right direction?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 04:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392080#M94264</guid>
      <dc:creator>bradja</dc:creator>
      <dc:date>2017-08-31T04:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get month as a string from date in the format 'mm'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392081#M94265</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;

dt='01Jan17'd;
mon_val=put(month(dt),z2.);
put mon_val=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 04:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392081#M94265</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2017-08-31T04:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get month as a string from date in the format 'mm'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392082#M94266</link>
      <description>You my friend, are a legend.&lt;BR /&gt;This appears to do exactly what I need!</description>
      <pubDate>Thu, 31 Aug 2017 04:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-month-as-a-string-from-date-in-the-format-mm/m-p/392082#M94266</guid>
      <dc:creator>bradja</dc:creator>
      <dc:date>2017-08-31T04:41:35Z</dc:date>
    </item>
  </channel>
</rss>

