<?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: Date with just month and year in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54192#M15008</link>
    <description>in place of this statement &lt;B&gt;format mydate date9.;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
use this:&lt;BR /&gt;
&lt;I&gt;&lt;B&gt; format mydate monyy5.;&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
this will give you the "Jan09" output.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Saurabh.</description>
    <pubDate>Tue, 09 Feb 2010 08:02:05 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-02-09T08:02:05Z</dc:date>
    <item>
      <title>Date with just month and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54190#M15006</link>
      <description>I have two variables: year (ie 2005-2009) and month (ie 1-12).&lt;BR /&gt;
How can I create a date variable that displays, eg, Jan08 (or even better Jan-08)?&lt;BR /&gt;
Thank you.</description>
      <pubDate>Mon, 08 Feb 2010 22:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54190#M15006</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-08T22:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date with just month and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54191#M15007</link>
      <description>In a DATA step, you will need to construct a suitable SAS character variable, one having a format that is suitable for any of the SAS-default INFORMATs.  You can use the SUBSTR or possibly the SCAN function to parse your character values.  &lt;BR /&gt;
&lt;BR /&gt;
Here is an example:&lt;BR /&gt;
&lt;BR /&gt;
1    data _null_;&lt;BR /&gt;
2    retain year '2009-2005' month '1-12';&lt;BR /&gt;
3    cmydate = scan(year,1,'-') !! '-' !! scan(month,1,'-') !! '-01';&lt;BR /&gt;
4    format mydate date9.;&lt;BR /&gt;
5    mydate = input(cmydate,yymmdd10.);&lt;BR /&gt;
6    put _all_;&lt;BR /&gt;
7    run;&lt;BR /&gt;
&lt;BR /&gt;
year=2009-2005 month=1-12 cmydate=2009-1-01 mydate=01JAN2009 _ERROR_=0 _N_=1&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 second&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 09 Feb 2010 02:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54191#M15007</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-09T02:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date with just month and year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54192#M15008</link>
      <description>in place of this statement &lt;B&gt;format mydate date9.;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
use this:&lt;BR /&gt;
&lt;I&gt;&lt;B&gt; format mydate monyy5.;&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
this will give you the "Jan09" output.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Saurabh.</description>
      <pubDate>Tue, 09 Feb 2010 08:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-with-just-month-and-year/m-p/54192#M15008</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-09T08:02:05Z</dc:date>
    </item>
  </channel>
</rss>

