<?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: Unscheduled visits in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348320#M80645</link>
    <description>&lt;P&gt;I am guessing that you want to identify the dates where doses were missed. If that is so, then one possibility would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
  informat date date9.;
  format date date9.;
  input id $ date dose;
  cards;
001     01jan2012      10
001     08jan2012       20
001     20jan2012       30
001     27jan2012       40
001     02jan2012       99
001     03jan2012       99
002     02jan2012      10
002     05jan2012      20
002     03jan2012      99
;

data want (drop=date last_date dose rename=(missed_date=date));
  set test;
  format missed_date date9.;
  by id;
  last_date=ifn(first.id,date,lag(date));
  if date-last_date gt 1 then do;
    do missed_date=last_date+1 to date-1;
      output;
    end;
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 21:43:48 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-04-07T21:43:48Z</dc:date>
    <item>
      <title>Unscheduled visits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348313#M80640</link>
      <description>&lt;P&gt;How to find the unscheduled visits?&lt;/P&gt;&lt;P&gt;001 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;01jan2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;001 &amp;nbsp; &amp;nbsp; 08jan2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;/P&gt;&lt;P&gt;001 &amp;nbsp; &amp;nbsp; 20jan2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;&lt;P&gt;001 &amp;nbsp; &amp;nbsp; 27jan2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; 40&lt;/P&gt;&lt;P&gt;001 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;02jan2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; 99&lt;/P&gt;&lt;P&gt;001 &amp;nbsp; &amp;nbsp; 03jan2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; 99&lt;/P&gt;&lt;P&gt;002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02jan2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05jan2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;/P&gt;&lt;P&gt;002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03jan2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 99&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 21:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348313#M80640</guid>
      <dc:creator>molla</dc:creator>
      <dc:date>2017-04-07T21:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unscheduled visits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348317#M80643</link>
      <description>&lt;P&gt;What's the definition of an unscheduled visit?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post the data as a data step, see examples from your previous questions as well as what the results should look like. Anything you've tried so far would also be helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. It seems like you post a question, then try to work on it or continue working on it. &amp;nbsp;I would highly suggest trying to phrase your questions according to the 'How to Ask a Good Question' guidelines. 80% of the time I find the answer myself before I finish that process.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/help/how-to-ask" target="_blank"&gt;https://stackoverflow.com/help/how-to-ask&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/help/mcve" target="_blank"&gt;https://stackoverflow.com/help/mcve&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 21:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348317#M80643</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-07T21:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unscheduled visits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348319#M80644</link>
      <description>&lt;P&gt;Thanks for the slightly more descriptive subject line &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 21:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348319#M80644</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-07T21:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unscheduled visits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348320#M80645</link>
      <description>&lt;P&gt;I am guessing that you want to identify the dates where doses were missed. If that is so, then one possibility would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
  informat date date9.;
  format date date9.;
  input id $ date dose;
  cards;
001     01jan2012      10
001     08jan2012       20
001     20jan2012       30
001     27jan2012       40
001     02jan2012       99
001     03jan2012       99
002     02jan2012      10
002     05jan2012      20
002     03jan2012      99
;

data want (drop=date last_date dose rename=(missed_date=date));
  set test;
  format missed_date date9.;
  by id;
  last_date=ifn(first.id,date,lag(date));
  if date-last_date gt 1 then do;
    do missed_date=last_date+1 to date-1;
      output;
    end;
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 21:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unscheduled-visits/m-p/348320#M80645</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-07T21:43:48Z</dc:date>
    </item>
  </channel>
</rss>

