<?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 Function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527335#M143749</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183598"&gt;@parmis&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;but it doesn't work&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you see that is wrong? What are the outputs? What do you expect to get?&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jan 2019 15:27:56 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-01-15T15:27:56Z</dc:date>
    <item>
      <title>INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527331#M143747</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with the following code, please.&lt;/P&gt;&lt;P&gt;I'm trying to count the number of each days for the current month. I have also tried Today() for the date, but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;d0 = intnx( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'31jan2019'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; ) - &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;d1 = intnx( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'1feb2019'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; ) - &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Sunday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Monday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Tuesday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.3'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Wedday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.4'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Thurday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.5'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Friday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.6'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;Satday = intck( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'week.7'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, d0, d1 );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; d0 d1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks for your help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 15:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527331#M143747</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2019-01-15T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527335#M143749</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183598"&gt;@parmis&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;but it doesn't work&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you see that is wrong? What are the outputs? What do you expect to get?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 15:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527335#M143749</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-15T15:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527336#M143750</link>
      <description>&lt;P&gt;Perhaps you could use INTNX instead?&lt;/P&gt;
&lt;P&gt;Untested:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;intnx('MONTH',"&amp;amp;Ssydate9."d,0,'END') - intnx('MONTH',"&amp;amp;Sysdate9."D,0,'BEGINNING) +1 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jan 2019 15:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527336#M143750</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-01-15T15:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527362#M143760</link>
      <description>&lt;PRE&gt;numberofdaysinmonth = day(intnx('month',today(),0,'E'));&lt;/PRE&gt;
&lt;P&gt;the last parameter 'E' says to get the end of a period, in this case the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which code that you show did you expect to get the number of days in a month?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527362#M143760</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-15T16:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527363#M143761</link>
      <description>&lt;P&gt;Correct me if I'm wrong ... it looks like you are trying to count the number of Sundays, number of Mondays, etc. in the current month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's the case, skip counting the first 28 days of the month.&amp;nbsp; You already know there are 4 of each weekday in that time period.&amp;nbsp; Just count from day 29 to the end of the month:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array days {7} Sunday Monday Tuesday Wedday Thurday Friday Satday;&lt;/P&gt;
&lt;P&gt;do d = 1 to 7;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;days{d} = 4;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;do d = 28 + intnx('month', today(), 0, 'begin') to intnx('month', today(), 0, 'end');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;days{weekday(d)} + 1;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;drop d;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should even work for February, where SAS would skip the final DO loop.&amp;nbsp; (And you can always switch from today() to "&amp;amp;sysdate9"d)&amp;nbsp; But it is untested code.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527363#M143761</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-15T16:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527364#M143762</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183598"&gt;@parmis&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1kdveu0ry8ltxn1m3um2ntxs7d5.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;NWKDOM&lt;/A&gt; function for this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
do wd=1 to 7; /* 1=Sunday, 2=Monday, ... */
  n=4+(day(nwkdom(5,wd,month(today()),year(today())))&amp;gt;28);
  output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527364#M143762</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-01-15T16:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527411#M143775</link>
      <description>&lt;P&gt;The table returns no result. I would need to have 8 separate column: Date, Sunday, Monday, Tuesday...&lt;/P&gt;&lt;P&gt;I'd need to get the counts for each day in a month.&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Sunday&amp;nbsp; &amp;nbsp;Monday&amp;nbsp;&amp;nbsp; Tuesday&lt;/P&gt;&lt;P&gt;Jan2019&amp;nbsp;&amp;nbsp;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 18:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527411#M143775</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2019-01-15T18:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527423#M143780</link>
      <description>&lt;P&gt;thank you very much! this is exactly what I wanted. how can I keep the date along with other fields?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 18:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527423#M143780</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2019-01-15T18:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527447#M143788</link>
      <description>&lt;P&gt;This program doesn't drop any variables.&amp;nbsp; What date did you want to keep?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 18:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527447#M143788</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-15T18:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527455#M143793</link>
      <description>&lt;P&gt;In the table, I'd like to have the date as well, but I only have the days of the week with the counts.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527455#M143793</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2019-01-15T19:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527458#M143795</link>
      <description>&lt;P&gt;You will have to give an example then.&amp;nbsp; What date are you talking about?&amp;nbsp; Today's date?&amp;nbsp; A date that comes from the incoming data?&amp;nbsp; Somehow, "keep the date" triggers the same question ... which date do you want to keep?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527458#M143795</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-15T19:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527459#M143796</link>
      <description>&lt;P&gt;yes, I'd like to have today's date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Sunday&amp;nbsp; &amp;nbsp;Monday&amp;nbsp;&amp;nbsp; Tuesday ....&lt;/P&gt;&lt;P&gt;Jan2019&amp;nbsp;&amp;nbsp;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527459#M143796</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2019-01-15T19:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527462#M143798</link>
      <description>&lt;P&gt;You can add a statement to the DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;date = today();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If speed is an issue, this would be slightly faster:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;date = "&amp;amp;sysdate9"d;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if your program begins before midnight and ends after midnight, the results could be slightly different.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527462#M143798</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-15T19:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527468#M143803</link>
      <description>&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTCK-Function/m-p/527468#M143803</guid>
      <dc:creator>parmis</dc:creator>
      <dc:date>2019-01-15T19:18:09Z</dc:date>
    </item>
  </channel>
</rss>

