<?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 creating 2 cohorts based on dates from 2005 versus 2015 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468101#M285400</link>
    <description>&lt;P&gt;Rusty coder here ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set with the dates from either 2005 or 2015 (format is&amp;nbsp;YYMMDD10.). They all are currently under 1 variable: dovcug&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create&amp;nbsp;2 cohorts of subjects based on the time period they are from, the variable called "cohort" with 0 =&amp;nbsp;all dates from 2005 and 1 = all dates from 2015. This is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if dovcug &amp;lt; 2006-01-01 then Cohort = 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if dovcug &amp;gt; 2014-12-31 then Cohort = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when&amp;nbsp;I run proc freq on "Cohort" I only get:&lt;/P&gt;&lt;P&gt;cohort = 1&lt;/P&gt;&lt;P&gt;Frequency = 517&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No cohort = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What am doing incorrectly???&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jun 2018 15:21:26 GMT</pubDate>
    <dc:creator>bkv1</dc:creator>
    <dc:date>2018-06-06T15:21:26Z</dc:date>
    <item>
      <title>need help creating 2 cohorts based on dates from 2005 versus 2015</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468101#M285400</link>
      <description>&lt;P&gt;Rusty coder here ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set with the dates from either 2005 or 2015 (format is&amp;nbsp;YYMMDD10.). They all are currently under 1 variable: dovcug&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create&amp;nbsp;2 cohorts of subjects based on the time period they are from, the variable called "cohort" with 0 =&amp;nbsp;all dates from 2005 and 1 = all dates from 2015. This is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if dovcug &amp;lt; 2006-01-01 then Cohort = 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if dovcug &amp;gt; 2014-12-31 then Cohort = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when&amp;nbsp;I run proc freq on "Cohort" I only get:&lt;/P&gt;&lt;P&gt;cohort = 1&lt;/P&gt;&lt;P&gt;Frequency = 517&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No cohort = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What am doing incorrectly???&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 15:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468101#M285400</guid>
      <dc:creator>bkv1</dc:creator>
      <dc:date>2018-06-06T15:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: need help creating 2 cohorts based on dates from 2005 versus 2015</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468103#M285401</link>
      <description>&lt;P&gt;do you not need a sas date constant like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if dovcug &amp;lt;&lt;STRONG&gt; '01jan2006'd&lt;/STRONG&gt; then Cohort = 0;&lt;BR /&gt;else if dovcug &amp;gt; &lt;STRONG&gt;'31dec2014'd t&lt;/STRONG&gt;hen Cohort = 1;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 15:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468103#M285401</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-06T15:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: need help creating 2 cohorts based on dates from 2005 versus 2015</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468107#M285402</link>
      <description>&lt;P&gt;if year(dovcug) = 2005 then cohort=0;&lt;/P&gt;
&lt;P&gt;else if year(dovcug)=2015 then cohort=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your logic is the year, use the YEAR()&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 15:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468107#M285402</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-06T15:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: need help creating 2 cohorts based on dates from 2005 versus 2015</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468108#M285403</link>
      <description>&lt;P&gt;That worked. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 15:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-help-creating-2-cohorts-based-on-dates-from-2005-versus/m-p/468108#M285403</guid>
      <dc:creator>bkv1</dc:creator>
      <dc:date>2018-06-06T15:37:34Z</dc:date>
    </item>
  </channel>
</rss>

