<?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: AE overlap programming query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909998#M358899</link>
    <description>&lt;P&gt;Thanks Kurt , it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jan 2024 12:11:29 GMT</pubDate>
    <dc:creator>abhinayingole</dc:creator>
    <dc:date>2024-01-01T12:11:29Z</dc:date>
    <item>
      <title>AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909907#M358851</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need to create SUBJOIN variable as shown below.&lt;/P&gt;
&lt;P&gt;I have information till JOIN variable.&lt;/P&gt;
&lt;P&gt;the dataset sorted by USUBJID AE ASTDT AENDT JOIN.&lt;/P&gt;
&lt;P&gt;JOIN variable reflects the overlapping Adverse Event.&lt;/P&gt;
&lt;P&gt;we need to created SUBJOIN variable for every USUBJID&amp;nbsp; AE JOIN group.&lt;/P&gt;
&lt;P&gt;if the AENDT&amp;nbsp;date of the prior AE is not the ASTDT date of the next AE, then we need to create SUBJOIN as +1.&lt;/P&gt;
&lt;P&gt;If the start date of the next AE is the end date of the previous AE record then AJOINSID remains the same. (that is why we have SUBJOIN = 1 for obs. no. 5, as the 17JAN2023 is the end date for obs. no. 2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;first and last obs. have value 0 because they don't have any overlapping event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could you please help me program this?&lt;/P&gt;
&lt;P&gt;I am also attaching the datalines for this dataset for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abhinayingole_0-1703868859213.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92129i96627CF7CA5DC16E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abhinayingole_0-1703868859213.png" alt="abhinayingole_0-1703868859213.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
informat astdt date9. aendt date9.;
input @1 usubjid $3.
@5 astdt date9.
@15 aendt date9.
@25 ae $5.
@31 join 1.
;

format astdt aendt date9.;

datalines;
128	03JAN2023 10JAN2023	cough 1
128	27DEC2022 17JAN2023	vomit 1
128	03JAN2023 17JAN2023	vomit 1
128	10JAN2023 24JAN2023	vomit 1
128	17JAN2023 28FEB2023	vomit 1
128	31JAN2023 14FEB2023	vomit 1
128	31JAN2023 14FEB2023	vomit 1
128	21FEB2023 28FEB2023	vomit 1
128	28FEB2023 21MAR2023	vomit 1
128	11APR2023 .	        vomit 2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Dec 2023 17:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909907#M358851</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2023-12-29T17:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909910#M358853</link>
      <description>&lt;P&gt;Per your description, subjoin for observation 2 should be 0, as a new ae group starts.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 18:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909910#M358853</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-29T18:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909929#M358865</link>
      <description>&lt;P&gt;No Kurt, as obs. no. 2 to 9 are the overlapping AEs with AE = vomit and JOIN = 1, so they need subgrouping, which is why they need to start with 1.&lt;/P&gt;
&lt;P&gt;Please let me know if this information helps.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 06:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909929#M358865</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2023-12-30T06:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909930#M358866</link>
      <description>&lt;P&gt;So it actually means: if there is only one observation, then subjoin = 0, otherwise we start with 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why is subjoin = 1 in obs 9? It belongs to the same group, and the start date is equal to the previous end date, so it should continue with 6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what is the &lt;U&gt;exact&lt;/U&gt; rule for obs 5 getting 1?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 08:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909930#M358866</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-30T08:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909931#M358867</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;
&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;yes, you are correct with this statement....&lt;STRONG&gt;So it actually means: if there is only one observation, then subjoin = 0, otherwise we start with 1.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUBJOIN value obs. no. 9 and 5 are 1 because of this rule....&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If the start date of the next AE is the end date of the previous AE record then AJOINSID remains the same.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;so in case of obs. no. 9. ASTDT =28FEB2023 is the end date of 5th obs. (i.e AENDT = 28FEB2023) so the SUBJOIN value will be the whatever value is from 5th obs. in this case obs. no . 5 SUBJOIN =1 so it will be same for obs. no. 9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in case of obs. no. 5. ASTDT =17JAN2023 is the end date of 2nd obs. (i.e AENDT = 17JAN2023) so the SUBJOIN value will be the whatever value is from 2nd obs. in this case obs. no . 2 SUBJOIN =1 so it will be same for obs. no. 5.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2023 09:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909931#M358867</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2023-12-30T09:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909943#M358871</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set test;
by usubjid ae join;
length subjoin 8 maxjoin 8;
retain maxjoin;
if _n_ = 1
then do;
  declare hash end ();
  end.definekey("aendt");
  end.definedata("subjoin");
  end.definedone();
end;
if first.join and last.join
then subjoin = 0;
else do;
  if first.join
  then do;
    rc = end.clear();
    maxjoin = 1;
    subjoin = 1;
    rc = end.add();
  end;
  else do;
    if end.find(key:astdt) ne 0
    then do;
      maxjoin + 1;
      subjoin = maxjoin;
      rc = end.add();
    end;
    else do;
      if end.check() ne 0
      then rc = end.add();
    end;
  end;
end;
drop rc maxjoin;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Dec 2023 17:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909943#M358871</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-30T17:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909998#M358899</link>
      <description>&lt;P&gt;Thanks Kurt , it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jan 2024 12:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/909998#M358899</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2024-01-01T12:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/910007#M358903</link>
      <description>&lt;P&gt;Since the code uses a hash object, which is a rather advanced feature of the DATA step, feel free to ask if it's not entirely clear to you.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jan 2024 15:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/910007#M358903</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-01T15:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: AE overlap programming query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/910008#M358904</link>
      <description>&lt;P&gt;Hi Kurt,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, sure... I was also looking for more on DECLARE HASH.&lt;/P&gt;
&lt;P&gt;Surely will get back to you if more information needed. Really appreciate your help.&lt;/P&gt;
&lt;P&gt;However, I need your help with one more variable with this data. I will start different discussion for this.&lt;/P&gt;
&lt;P&gt;Hope to see you there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jan 2024 15:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AE-overlap-programming-query/m-p/910008#M358904</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2024-01-01T15:52:17Z</dc:date>
    </item>
  </channel>
</rss>

