<?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: Help with grouping by date range in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188873#M265947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, when I am copying and pasting my code into the Editor it is truncating my code or putting in paragraph form.&amp;nbsp; I am now mindful to ensure my code is correct before replying.&amp;nbsp; Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2015 21:02:45 GMT</pubDate>
    <dc:creator>kparker</dc:creator>
    <dc:date>2015-03-03T21:02:45Z</dc:date>
    <item>
      <title>Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188866#M265940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Help with grouping by date range.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have the following code in a Data Step and PROC SQL; however, my dates are only assigned to the "Other" category.&amp;nbsp; I cannot figure out the problem.&amp;nbsp; Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; Data grouping; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; set lalic;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; length Group $&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;15&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; if cover_start_dt &amp;lt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2009'd&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group= &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"Less Than"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; else &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2009'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2009'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2009"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; else &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2010'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2010'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2010"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt; else if&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2011'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2011'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2011"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt; else if&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2012'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2012'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2012"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; else &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2013'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2013'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2013"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt; else if&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2014'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2014'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2014"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; else Group = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"Other"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; keep lalic_ID Admit_dt Cover_start_dt Cover_end_dt zip_cd importFile_ID Group;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt; run;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; color: #000080; font-family: Courier New;"&gt;proc sql&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: Courier New;"&gt;create &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; lalic2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;select&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.encounter_id,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; t2.medrec_no,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; datepart (t2.admit_dt)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Admission_dt format=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-family: Courier New;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; datepart (t2.cover_start_dt) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Start_dt format=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-family: Courier New;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; datepart (t2.cover_end_dt) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; End_dt format=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-family: Courier New;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; t2.gender,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; t2.age,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; t2.race&lt;BR /&gt;case &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;lt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2009'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"Less Than"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2009'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2009'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2009"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;&amp;nbsp; when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2010'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2010'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2010"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2011'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2011'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2011"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;&amp;nbsp; when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2012'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2012'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2012"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2013'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2013'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2013"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (t2.cover_start_dt &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'01JAN2014'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; t2.cover_start_dt &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-family: Courier New;"&gt;'31DEC2014'D&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"2014"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;&amp;nbsp; else&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New;"&gt;"Other"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Dategroup&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; from sqldb.dbo_lalic t2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; quit;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 16:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188866#M265940</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-03-02T16:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188867#M265941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a feeling that your 'cover_start_dt" is a datetime variable instead. I have no idea on the impact of efficiency, but I will just do the following to avoid typing much:&lt;/P&gt;&lt;P&gt;Data grouping;&lt;/P&gt;&lt;P&gt;set lalic;&lt;/P&gt;&lt;P&gt;length Group $15;&lt;/P&gt;&lt;P&gt;_n_=year(datepart(cover_start_dt));&lt;/P&gt;&lt;P&gt;if _n_ &amp;lt;2009, then Group= "Less Than";&lt;/P&gt;&lt;P&gt;else if _n_ &amp;gt;2014 then Group='Others';&lt;/P&gt;&lt;P&gt;else&amp;nbsp; group=put(_n_,4.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: haikuo bian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 17:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188867#M265941</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-03-02T17:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188868#M265942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct. Cover_start_dt is a datetime variable.&amp;nbsp; I will definitely give your code a try and let you know how it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 18:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188868#M265942</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-03-02T18:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188869#M265943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hai.Kuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code worked to group 2009 but not for 2104 because I do not have any dates &amp;gt;2014.&amp;nbsp; I need date ranges between 1/1/2014 to 12/31/2014. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kolynda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 18:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188869#M265943</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-03-02T18:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188870#M265944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your help! The following code worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Data grouping;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; lalic;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Group $&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;15&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;lt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2009'd&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"Less Than"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2010'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2010'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"2010"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2011'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2011'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"2011"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2012'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2012'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"2012"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2013'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2013'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"2013"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2014'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; a &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2014'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"2014"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Group=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'Others'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 18:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188870#M265944</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-03-02T18:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188871#M265945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That isn't valid SAS code, you're missing Group= from each of the if statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use a smaller set of code that is a bit more dynamic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year=year(datepart(a));&lt;/P&gt;&lt;P&gt;if year&amp;lt;2009 then group="Less Than";&lt;/P&gt;&lt;P&gt;else if year&amp;gt;2014 then group="Others";&lt;/P&gt;&lt;P&gt;else group=put(year, 4. -l);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your ranges change in the future you can easily change the boundaries. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 19:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188871#M265945</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-02T19:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188872#M265946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct. Below is the exact copy of the code I used with the Group= included. I was able to run a proc freq to give me what I needed.&amp;nbsp; I tried to use the year but I needed a specific date range. When I used "year" only, it did not assign the data to the groups correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Data grouping;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; lalic;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Group $&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;15&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Date=datepart(cover_start_dt);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;gt;= &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2009'd&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;lt;= &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2009'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;Group=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"2009"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2010'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2010'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;Group= "2010"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2011'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2011'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;Group= "2011"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2012'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2012'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;Group= "2012"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2013'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2013'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;Group= "2013"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'01JAN2014'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date &amp;lt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;'31DEC2014'D&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;Group= "2014"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Group=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'Other'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Lalic_ID Admit_dt Cover_start_dt Cover_end_dt zip_cd importFile_ID Group;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;proc &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;freq&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;= grouping &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;nlevels&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; table group /&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=Groupdate &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;outcum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;nopercent&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 21:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188872#M265946</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-03-03T21:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with grouping by date range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188873#M265947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, when I am copying and pasting my code into the Editor it is truncating my code or putting in paragraph form.&amp;nbsp; I am now mindful to ensure my code is correct before replying.&amp;nbsp; Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 21:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-grouping-by-date-range/m-p/188873#M265947</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-03-03T21:02:45Z</dc:date>
    </item>
  </channel>
</rss>

