<?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: Categorizing dates by cycles in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76147#M3642</link>
    <description>I need to clarify. The data is above. Let's say I have the year 1972. That could be either cycle 1 or cycle 2. If I have the year 1979, that could be cycle 3 or 4. How do I do that in PROC SQL?</description>
    <pubDate>Mon, 26 Apr 2010 00:49:58 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-04-26T00:49:58Z</dc:date>
    <item>
      <title>Categorizing dates by cycles</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76146#M3641</link>
      <description>The data set I have has countless of records. The records are dated under variable FILMDATE. And FILMDATEs are categorized by cycles. I want to categorize the FILMDATEs. Here is my data below:&lt;BR /&gt;
Cycle 1 if visited the clinic between 1969 and 1973&lt;BR /&gt;
Cycle 2 if visited the clinic between 1971 and 1976&lt;BR /&gt;
Cycle 3 if visited the clinic between 1975 and 1980&lt;BR /&gt;
Cycle 4 if visited the clinic between 1978 and 1982&lt;BR /&gt;
Cycle 5 if visited the clinic between 1981 and 1985&lt;BR /&gt;
If the year in FILMDATE does not match the range defined for each cycle, then I want to keep the value of the cycle but create  a new date variable where the incorrect value of FILMDATE is replaced by the year at midpoint of the range for each cycle (like 1971 for cycle 1).&lt;BR /&gt;
How do I do this using PROC SQL?</description>
      <pubDate>Thu, 22 Apr 2010 02:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76146#M3641</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-22T02:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Categorizing dates by cycles</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76147#M3642</link>
      <description>I need to clarify. The data is above. Let's say I have the year 1972. That could be either cycle 1 or cycle 2. If I have the year 1979, that could be cycle 3 or 4. How do I do that in PROC SQL?</description>
      <pubDate>Mon, 26 Apr 2010 00:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76147#M3642</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-26T00:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Categorizing dates by cycles</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76148#M3643</link>
      <description>"If I have the year 1979, that could be cycle 3 or 4. How do I do that in PROC SQL? "&lt;BR /&gt;
&lt;BR /&gt;
So what should it be then? What's the logic to decide whether it's cycle 3 or 4?&lt;BR /&gt;
&lt;BR /&gt;
Without knowing that one can't even start coding.&lt;BR /&gt;
&lt;BR /&gt;
Does it have to be in SQL (and why) or would a SAS datastep do as well?&lt;BR /&gt;
&lt;BR /&gt;
You will get the best answers by providing sample data (SAS data step creating this data) and then give an example of how the desired output should look like.

Message was edited by: Patrick</description>
      <pubDate>Mon, 26 Apr 2010 12:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorizing-dates-by-cycles/m-p/76148#M3643</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-04-26T12:26:41Z</dc:date>
    </item>
  </channel>
</rss>

