<?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 Need help converting date and &amp;quot;between&amp;quot; statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185044#M35132</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could use your expertise in something, trying to format a date to be able to pull together a new column of fiscal months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the data set has AccountDate which looks like: 01APR2014 (has 15 years of dates).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write my code so I roll up all dates into their respective months, so any date that falls between (April 1 and April 30 of 2014 goes into New_Month = April_2014).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data field is currently&amp;nbsp; DATE9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 15:29:28 GMT</pubDate>
    <dc:creator>Breezy</dc:creator>
    <dc:date>2014-07-18T15:29:28Z</dc:date>
    <item>
      <title>Need help converting date and "between" statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185044#M35132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could use your expertise in something, trying to format a date to be able to pull together a new column of fiscal months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the data set has AccountDate which looks like: 01APR2014 (has 15 years of dates).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write my code so I roll up all dates into their respective months, so any date that falls between (April 1 and April 30 of 2014 goes into New_Month = April_2014).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data field is currently&amp;nbsp; DATE9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 15:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185044#M35132</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2014-07-18T15:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help converting date and "between" statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185045#M35133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the monyy7. format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197959.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197959.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 15:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185045#M35133</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-07-18T15:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help converting date and "between" statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185046#M35134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, that worked!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 15:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185046#M35134</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2014-07-18T15:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help converting date and "between" statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185047#M35135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on what you are doing you might just need to apply a format.&lt;/P&gt;&lt;P&gt;proc freq data=mydata ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tables mydate ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format mydate monyy7.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do need to make a new variable then perhaps INTNX() is what you want?&lt;/P&gt;&lt;P&gt;You could set the new variable to the first of the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newvar = intnx('month',mydate,0) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could then use what ever format you want for the new variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 15:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-converting-date-and-quot-between-quot-statement/m-p/185047#M35135</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-18T15:47:48Z</dc:date>
    </item>
  </channel>
</rss>

