<?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: calculate month from date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49997#M10429</link>
    <description>Recommended SAS DOC reading on Dates and using INPUT function to convert from characters and using MONTH function.  Google advanced search argument:&lt;BR /&gt;
&lt;BR /&gt;
using sas date variables site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Mon, 01 Feb 2010 15:49:25 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-02-01T15:49:25Z</dc:date>
    <item>
      <title>calculate month from date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49996#M10428</link>
      <description>I've x=20090801 ( as $8 char)&lt;BR /&gt;
&lt;BR /&gt;
I want to calculate y = month(x), so that y = 08. &lt;BR /&gt;
&lt;BR /&gt;
But if i use it like this it gives me . (missing values).&lt;BR /&gt;
&lt;BR /&gt;
Please sugest.</description>
      <pubDate>Mon, 01 Feb 2010 15:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49996#M10428</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-01T15:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: calculate month from date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49997#M10429</link>
      <description>Recommended SAS DOC reading on Dates and using INPUT function to convert from characters and using MONTH function.  Google advanced search argument:&lt;BR /&gt;
&lt;BR /&gt;
using sas date variables site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 01 Feb 2010 15:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49997#M10429</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-01T15:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate month from date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49998#M10430</link>
      <description>You have x as a character string for date with a yymmddn8. format.&lt;BR /&gt;
The simplest method is to use a simple substring:&lt;BR /&gt;
   month = substr(x,5,2); &lt;BR /&gt;
This create month as a string. If you want month as a numeric:&lt;BR /&gt;
   month = input(substr(x,5,2),2.);&lt;BR /&gt;
&lt;BR /&gt;
If you want to use the month function you need to first convert the string to a SAS date.&lt;BR /&gt;
   date = input(x,yymmdd8.);&lt;BR /&gt;
   y = month(date);</description>
      <pubDate>Wed, 03 Feb 2010 15:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-month-from-date/m-p/49998#M10430</guid>
      <dc:creator>barheat</dc:creator>
      <dc:date>2010-02-03T15:27:41Z</dc:date>
    </item>
  </channel>
</rss>

