<?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: Finding overlapping durations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298526#M62800</link>
    <description>&lt;P&gt;Excellent. This is exactly what i was looking for.&lt;/P&gt;&lt;P&gt;Thanks man.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2016 06:43:23 GMT</pubDate>
    <dc:creator>wizkid2050</dc:creator>
    <dc:date>2016-09-15T06:43:23Z</dc:date>
    <item>
      <title>Finding overlapping durations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298268#M62710</link>
      <description>&lt;P&gt;data test;&lt;BR /&gt;input start end_o id d1 d2 d3 ;&lt;BR /&gt;informat start date9. end_o date9. ;&lt;BR /&gt;format start date9. end_o date9. ;&lt;BR /&gt;datalines;&lt;BR /&gt;1jan95 20sep95 10 23 11 13&lt;BR /&gt;10feb96 21may98 10 9 8 10&lt;BR /&gt;20jan95 30apr95 10 11 17 16&lt;BR /&gt;1jan95 30dec95 10 23 11 43&lt;BR /&gt;3jan95 20may95 10 12 13 9&lt;BR /&gt;3feb10 28apr12 11 9 8 10&lt;BR /&gt;10feb99 21may00 11 9 8 10&lt;BR /&gt;20jan95 30apr00 11 11 17 16&lt;BR /&gt;1jan95 30dec95 11 23 11 43&lt;BR /&gt;;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this sample data set&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I need to find out the same director (d1,d2 or d3 ) being shown for overlapping duration in multiple rows for same id.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 11:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298268#M62710</guid>
      <dc:creator>wizkid2050</dc:creator>
      <dc:date>2016-09-14T11:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: BASE Sas Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298271#M62711</link>
      <description>&lt;P&gt;Can you show what you'd expect as output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 10:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298271#M62711</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-14T10:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: BASE Sas Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298272#M62712</link>
      <description>&lt;P&gt;Can you show what you'd expect as output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 10:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298272#M62712</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-14T10:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: BASE Sas Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298275#M62713</link>
      <description>&lt;P&gt;ID &amp;nbsp; &amp;nbsp;Common_Directors&lt;/P&gt;&lt;P&gt;10 &amp;nbsp; &amp;nbsp;23,11,13,9&lt;/P&gt;&lt;P&gt;11 &amp;nbsp; &amp;nbsp; 9,8,10,11&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp;Common_directors&lt;/P&gt;&lt;P&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp;23&lt;/P&gt;&lt;P&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp;11&lt;/P&gt;&lt;P&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp;13&lt;/P&gt;&lt;P&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;&lt;P&gt;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;&lt;P&gt;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;11 &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;11 &amp;nbsp; &amp;nbsp; 11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should be the output for above sample dataset.&lt;/P&gt;&lt;P&gt;The comparison has to be made for d1 with all observation in d1, d2, d3 and like wise for d2 with all and d3 with all.&lt;/P&gt;&lt;P&gt;Hope you understand the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 10:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298275#M62713</guid>
      <dc:creator>wizkid2050</dc:creator>
      <dc:date>2016-09-14T10:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: BASE Sas Problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298279#M62714</link>
      <description>&lt;P&gt;Hi try below code, from your output exsample I think this will 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;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; start end_o id d1 d2 d3 ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;informat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; start &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; end_o &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; start &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; end_o &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;1jan95 20sep95 10 23 11 13&lt;/P&gt;&lt;P&gt;10feb96 21may98 10 9 8 10&lt;/P&gt;&lt;P&gt;20jan95 30apr95 10 11 17 16&lt;/P&gt;&lt;P&gt;1jan95 30dec95 10 23 11 43&lt;/P&gt;&lt;P&gt;3jan95 20may95 10 12 13 9&lt;/P&gt;&lt;P&gt;3feb10 28apr12 11 9 8 10&lt;/P&gt;&lt;P&gt;10feb99 21may00 11 9 8 10&lt;/P&gt;&lt;P&gt;20jan95 30apr00 11 11 17 16&lt;/P&gt;&lt;P&gt;1jan95 30dec95 11 23 11 43&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=test;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; start end_o id;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;transpose&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=test &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=test1(rename=(col1=director));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; start end_o id;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; d:;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=test1 &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;=test2(drop=_name_);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; id director start end_o id;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 11:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298279#M62714</guid>
      <dc:creator>Tom_C_Mortensen</dc:creator>
      <dc:date>2016-09-14T11:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Overlapping Durations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298280#M62715</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input start end_o id d1 d2 d3 ;
informat start date9. end_o date9. ;
format start date9. end_o date9. ;
datalines;
1jan95 20sep95 10 23 11 13
10feb96 21may98 10 9 8 10
20jan95 30apr95 10 11 17 16
1jan95 30dec95 10 23 11 43
3jan95 20may95 10 12 13 9
3feb10 28apr12 11 9 8 10
10feb99 21may00 11 9 8 10
20jan95 30apr00 11 11 17 16
1jan95 30dec95 11 23 11 43
;
run;

*first, transpose;

data have (keep=start end_o id director);
set test;
array dir {*} d1-d3;
do i = 1 to dim(dir);
  director = dir{i};
  output;
end;
run;

proc sort data=have;
by id director start;
run;

data want (keep=id director);
set have;
by id director;
oldend = lag(end_o);
if not first.director and start &amp;lt;= oldend then output;
run;

proc sort data=want nodupkey;
by id director;
run;

proc print data=want noobs;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;id    director

10       11   
10       13   
10       23   
11       11   
&lt;/PRE&gt;
&lt;P&gt;Note that in your example result, ID 10 with director 9 and ID 11 with directors 8, 9 and 10 don't have overlaps.&lt;/P&gt;
&lt;P&gt;Unless you define "overlap" differently.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 11:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298280#M62715</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-14T11:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Overlapping Durations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298319#M62730</link>
      <description>&lt;P&gt;&lt;BR /&gt;See in second observation d1 = 9&lt;BR /&gt;and in 5th observation d3 = 9&lt;/P&gt;&lt;P&gt;I want to check d1 with all variables( d1,d2,d3). and then d2...&lt;BR /&gt;and if there is a duplicate found then store them with the respective id.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 13:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298319#M62730</guid>
      <dc:creator>wizkid2050</dc:creator>
      <dc:date>2016-09-14T13:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Finding overlapping durations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298498#M62785</link>
      <description>&lt;PRE&gt;
That is not called overlap durations.
If I understood right. you just want which director have duplicated value 
in the same ID group.



 data test;
input start end_o id d1 d2 d3 ;
informat start date9. end_o date9. ;
format start date9. end_o date9. ;
datalines;
1jan95 20sep95 10 23 11 13
10feb96 21may98 10 9 8 10
20jan95 30apr95 10 11 17 16
1jan95 30dec95 10 23 11 43
3jan95 20may95 10 12 13 9
3feb10 28apr12 11 9 8 10
10feb99 21may00 11 9 8 10
20jan95 30apr00 11 11 17 16
1jan95 30dec95 11 23 11 43
;
run;

*first, transpose;

data have (keep= id director);
set test;
array dir {*} d1-d3;
do i = 1 to dim(dir);
  director = dir{i};
  output;
end;
run;
proc sql;
create table want as
 select *
  from have
   group by id,director
    having count(*) gt 1;
quit;

&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Sep 2016 03:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298498#M62785</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-15T03:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Overlapping Durations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298520#M62798</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80369"&gt;@wizkid2050&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;See in second observation d1 = 9&lt;BR /&gt;and in 5th observation d3 = 9&lt;/P&gt;
&lt;P&gt;I want to check d1 with all variables( d1,d2,d3). and then d2...&lt;BR /&gt;and if there is a duplicate found then store them with the respective id.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, if the dates play no role at all, why are you looking for "overlapping durations"??&lt;/P&gt;
&lt;P&gt;You might consider to be more clear in the future.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 06:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298520#M62798</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-15T06:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Finding overlapping durations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298526#M62800</link>
      <description>&lt;P&gt;Excellent. This is exactly what i was looking for.&lt;/P&gt;&lt;P&gt;Thanks man.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 06:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-overlapping-durations/m-p/298526#M62800</guid>
      <dc:creator>wizkid2050</dc:creator>
      <dc:date>2016-09-15T06:43:23Z</dc:date>
    </item>
  </channel>
</rss>

