<?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: INTCK? Incremental count variables for # of weeks/months since hire? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489331#M127748</link>
    <description>&lt;P&gt;Thank you both! Both solutions give me the continuous index that I'm looking for --- but first solution is strictly referenced with respect to the calendar (e.g. month 2 begins when next calendar month after month of hire begins rather than 4 weeks after hire date) rather than a straight count index of number of weeks/months worked since date of hire (solution #2).&amp;nbsp; &amp;nbsp;Thank you for your help!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Aug 2018 17:04:36 GMT</pubDate>
    <dc:creator>SharonZS</dc:creator>
    <dc:date>2018-08-23T17:04:36Z</dc:date>
    <item>
      <title>INTCK? Incremental count variables for # of weeks/months since hire?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489100#M127595</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to create incremental count variables to identify the number of weeks and months since date of hire. I have dates of hire and termination and want to examine experiences during the first few weeks/months of employment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to use INTCK to do this using an example from Ron Cody (he uses&amp;nbsp; a fixed date for first date and dResultdate is my variable for date of termination):&amp;nbsp;&lt;/P&gt;&lt;P&gt;week_num=INTCK('WEEK', '28APR2016'D, dResultDate ) + 1 ;&lt;BR /&gt;mos_num=INTCK('MONTH', '28APR2016'D, dResultDate ) + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives me the ongoing count that I want for weeks and months since 04/28/16.&lt;/P&gt;&lt;P&gt;Is there a way to turn the fixed constant first date into a random variable for date of hire?&amp;nbsp; I keep getting a straight count constant for total number of weeks/months since hire.&amp;nbsp;&lt;SPAN&gt;I'm using SAS v9.4.&amp;nbsp;&lt;/SPAN&gt; I'll appreciate any suggestions anyone may have! Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 00:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489100#M127595</guid>
      <dc:creator>SharonZS</dc:creator>
      <dc:date>2018-08-23T00:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK? Incremental count variables for # of weeks/months since hire?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489106#M127599</link>
      <description>&lt;P&gt;It's certainly possible to use a variable as the second parameter to INTCK:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;week_num = intck('WEEK', HireDate, dResultDate) + 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, a general note of caution when using INTCK ... it measures boundaries crossed, not number of days.&amp;nbsp; Make sure you understand the results from running these statements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;week_num = INTCK('WEEK', '31Aug2018'd, '02Sep2018'd) + 1;&lt;/P&gt;
&lt;P&gt;month_num = INTCK('MONTH', '31Aug2018'd, '02Sep2018'd) + 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For that particular interval, the number of months is greater than the number of weeks.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 01:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489106#M127599</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-23T01:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK? Incremental count variables for # of weeks/months since hire?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489110#M127603</link>
      <description>&lt;P&gt;There is a fourth argument to INTCK that shouldn't be left to its default value here. Experiment with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;week_num = INTCK('WEEK', hireDate, dResultDate, "CONTINUOUS");
month_num = INTCK('MONTH', hireDate, dResultDate, "CONTINUOUS");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It returns the number of full weeks (months)&amp;nbsp;that have elapsed since hireDate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 02:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489110#M127603</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-08-23T02:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK? Incremental count variables for # of weeks/months since hire?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489331#M127748</link>
      <description>&lt;P&gt;Thank you both! Both solutions give me the continuous index that I'm looking for --- but first solution is strictly referenced with respect to the calendar (e.g. month 2 begins when next calendar month after month of hire begins rather than 4 weeks after hire date) rather than a straight count index of number of weeks/months worked since date of hire (solution #2).&amp;nbsp; &amp;nbsp;Thank you for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 17:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Incremental-count-variables-for-of-weeks-months-since-hire/m-p/489331#M127748</guid>
      <dc:creator>SharonZS</dc:creator>
      <dc:date>2018-08-23T17:04:36Z</dc:date>
    </item>
  </channel>
</rss>

