<?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: Count the visits in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131706#M35800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;You are right, I think "if subjid=lag(subjid) and dif(week)&amp;gt;1 and week ne 24 " should be "if subjid=lag(subjid) and dif(week)&amp;gt;1 ";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought OP wanted&lt;/P&gt;&lt;P&gt;"In the above case its going to be week 19 and 20 for subjid 102 since he missed week 21"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jul 2013 20:18:32 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2013-07-11T20:18:32Z</dc:date>
    <item>
      <title>Count the visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131702#M35796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;Here is an example where I need help with.&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;input subjid week product;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;101&amp;nbsp; 21&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;101&amp;nbsp; 22&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;101&amp;nbsp; 23&amp;nbsp; x1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;101&amp;nbsp; 24&amp;nbsp; x1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;102&amp;nbsp; 19&amp;nbsp; x1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;102&amp;nbsp; 20 x1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;102&amp;nbsp; 22&amp;nbsp; x1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;102&amp;nbsp; 23&amp;nbsp; x1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 24&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;What I would like to achieve here is to count the weeks to see when each subject stop as the ending period is 24 weeks and it has to be consistent without missing any week or else ignore those weeks where he missed.In the above case its going to be week 19 and 20 for subjid 102 since he missed week 21.So can someone tell me how can I do this? I appreciate any help I get.Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 14:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131702#M35796</guid>
      <dc:creator>DJ09</dc:creator>
      <dc:date>2013-07-11T14:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count the visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131703#M35797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;input subjid week product $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;101&amp;nbsp; 21&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;101&amp;nbsp; 22&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;101&amp;nbsp; 23&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;101&amp;nbsp; 24&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 19&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 20&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 22&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 23&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 24&amp;nbsp; x1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if subjid=lag(subjid) and dif(week)&amp;gt;1 and week ne 24 ;&lt;/P&gt;&lt;P&gt;data want(drop=n);&lt;/P&gt;&lt;P&gt; merge have temp(in=a rename=(week=n));&lt;/P&gt;&lt;P&gt; by subjid;&lt;/P&gt;&lt;P&gt; if a and week&amp;lt;n;&lt;/P&gt;&lt;P&gt; proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 14:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131703#M35797</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-07-11T14:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count the visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131704#M35798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Linlin for your prompt response! Got the desired results. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 15:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131704#M35798</guid>
      <dc:creator>DJ09</dc:creator>
      <dc:date>2013-07-11T15:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count the visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131705#M35799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a couple of questions&lt;/P&gt;&lt;P&gt;if subjid=lag(subjid) and dif(week)&amp;gt;1 and week ne 24 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)why is the weeek 24 not included?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)In the final dataset obtained we do not have any 101 at all???Why is that info ignored??i was thinking all the info must be included from Have dataset and only the misswing weeks info for a particular patient has to be eliminated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 18:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131705#M35799</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-07-11T18:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Count the visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131706#M35800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;You are right, I think "if subjid=lag(subjid) and dif(week)&amp;gt;1 and week ne 24 " should be "if subjid=lag(subjid) and dif(week)&amp;gt;1 ";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought OP wanted&lt;/P&gt;&lt;P&gt;"In the above case its going to be week 19 and 20 for subjid 102 since he missed week 21"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 20:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131706#M35800</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-07-11T20:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count the visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131707#M35801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thanks for the reply.&lt;/P&gt;&lt;P&gt;Also what about the 101's ?????&lt;/P&gt;&lt;P&gt;i was thinking WANT dataset would have 19 and 20 of 102 and also&lt;/P&gt;&lt;P&gt;21-24 of 101 because there are no missing months to eliminate??&lt;/P&gt;&lt;P&gt;How would we get to include those in our final dataset???&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2013 20:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Count-the-visits/m-p/131707#M35801</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-07-11T20:31:14Z</dc:date>
    </item>
  </channel>
</rss>

