<?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 2 digit month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211222#M39121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know one day the light bulb will go off, but I still struggle with SAS dates.&amp;nbsp; I want a 2 digit month variable called 'emo' that I can pass to other data steps.&amp;nbsp; It resolves to '2' and I want '02'.&amp;nbsp; Here's my code:&amp;nbsp; Mucho thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt; sdate = '01feb2015'd;&lt;BR /&gt; edate = '28feb2015'd;&lt;BR /&gt; &lt;BR /&gt; &lt;STRONG&gt;emo = month(edate);&lt;/STRONG&gt;&lt;BR /&gt; eyr = year(edate);&lt;/P&gt;&lt;P&gt; call symput ('sdate', "'"||trim(left(put(sdate, date9.)))||"'");&lt;BR /&gt; call symput ('edate', "'"||trim(left(put(edate, date9.)))||"'");&lt;BR /&gt;&lt;STRONG&gt; call symput ('emo',emo);&lt;/STRONG&gt;&lt;BR /&gt; call symput ('eyr',eyr);&lt;BR /&gt; &lt;STRONG&gt;put emo = 2.;&lt;/STRONG&gt;&lt;BR /&gt; fim_tu_wo = cats(of eyr,emo);&lt;BR /&gt; call symput ('fim_tu_wo', trim(left(put(fim_tu_wo,$7.))));&lt;/P&gt;&lt;P&gt;put _all_;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 15:57:57 GMT</pubDate>
    <dc:creator>BU2B</dc:creator>
    <dc:date>2015-03-26T15:57:57Z</dc:date>
    <item>
      <title>2 digit month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211222#M39121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know one day the light bulb will go off, but I still struggle with SAS dates.&amp;nbsp; I want a 2 digit month variable called 'emo' that I can pass to other data steps.&amp;nbsp; It resolves to '2' and I want '02'.&amp;nbsp; Here's my code:&amp;nbsp; Mucho thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt; sdate = '01feb2015'd;&lt;BR /&gt; edate = '28feb2015'd;&lt;BR /&gt; &lt;BR /&gt; &lt;STRONG&gt;emo = month(edate);&lt;/STRONG&gt;&lt;BR /&gt; eyr = year(edate);&lt;/P&gt;&lt;P&gt; call symput ('sdate', "'"||trim(left(put(sdate, date9.)))||"'");&lt;BR /&gt; call symput ('edate', "'"||trim(left(put(edate, date9.)))||"'");&lt;BR /&gt;&lt;STRONG&gt; call symput ('emo',emo);&lt;/STRONG&gt;&lt;BR /&gt; call symput ('eyr',eyr);&lt;BR /&gt; &lt;STRONG&gt;put emo = 2.;&lt;/STRONG&gt;&lt;BR /&gt; fim_tu_wo = cats(of eyr,emo);&lt;BR /&gt; call symput ('fim_tu_wo', trim(left(put(fim_tu_wo,$7.))));&lt;/P&gt;&lt;P&gt;put _all_;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 15:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211222#M39121</guid>
      <dc:creator>BU2B</dc:creator>
      <dc:date>2015-03-26T15:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: 2 digit month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211223#M39122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your emo variable is numeric then use Z2. format;&lt;/P&gt;&lt;P&gt;But if you are looking to create 201502&lt;/P&gt;&lt;P&gt;try call symput (fim_tu_wo, put(edate,yymmn6.));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 16:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211223#M39122</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-26T16:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: 2 digit month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211224#M39123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you sir!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 16:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-digit-month/m-p/211224#M39123</guid>
      <dc:creator>BU2B</dc:creator>
      <dc:date>2015-03-26T16:10:22Z</dc:date>
    </item>
  </channel>
</rss>

