<?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: Convert character month to numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665406#M198968</link>
    <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data month;
input m $5.;
monthnum = month(input(m||'2020',monyy7.));
datalines;
SEP
SEP
NOV
JAN
FEB
FEB
MAY
JAN
JUN
OCT
MAR
AUG
JUL
JUL
;
run;&lt;/PRE&gt;
&lt;P&gt;which inputs a string with a year appended using a monyy informat and extracts the month from that.&lt;/P&gt;
&lt;P&gt;Others 1) a bunch of If/then/else statements&lt;/P&gt;
&lt;P&gt;2) a select/ when block (a bit better than if/then/else&lt;/P&gt;
&lt;P&gt;3) a custom informat and and an input statement.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2020 16:29:37 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-06-26T16:29:37Z</dc:date>
    <item>
      <title>Convert character month to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665404#M198966</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to convert character month to numeric. Can you please help me with this....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below is the data:&lt;/P&gt;&lt;P&gt;data month;&lt;BR /&gt;input m $5.;&lt;BR /&gt;datalines;&lt;BR /&gt;SEP&lt;BR /&gt;SEP&lt;BR /&gt;NOV&lt;BR /&gt;JAN&lt;BR /&gt;FEB&lt;BR /&gt;FEB&lt;BR /&gt;MAY&lt;BR /&gt;JAN&lt;BR /&gt;JUN&lt;BR /&gt;OCT&lt;BR /&gt;MAR&lt;BR /&gt;AUG&lt;BR /&gt;JUL&lt;BR /&gt;JUL&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 16:22:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665404#M198966</guid>
      <dc:creator>chinna0369</dc:creator>
      <dc:date>2020-06-26T16:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character month to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665405#M198967</link>
      <description>&lt;P&gt;Asked, and answered, here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-month-to-number-from-1-to-12/td-p/492077" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/converting-month-to-number-from-1-to-12/td-p/492077&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 16:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665405#M198967</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2020-06-26T16:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character month to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665406#M198968</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data month;
input m $5.;
monthnum = month(input(m||'2020',monyy7.));
datalines;
SEP
SEP
NOV
JAN
FEB
FEB
MAY
JAN
JUN
OCT
MAR
AUG
JUL
JUL
;
run;&lt;/PRE&gt;
&lt;P&gt;which inputs a string with a year appended using a monyy informat and extracts the month from that.&lt;/P&gt;
&lt;P&gt;Others 1) a bunch of If/then/else statements&lt;/P&gt;
&lt;P&gt;2) a select/ when block (a bit better than if/then/else&lt;/P&gt;
&lt;P&gt;3) a custom informat and and an input statement.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 16:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-month-to-numeric/m-p/665406#M198968</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-26T16:29:37Z</dc:date>
    </item>
  </channel>
</rss>

