<?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: Need to create JOIN variable for OVERLAPPING AEs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969655#M376908</link>
    <description>&lt;P&gt;In order to make this work, you cannot have&amp;nbsp;aestdtc as a "character date" and aendt as a numeric date, since SAS does not know how to compare character strings to numbers. Making&amp;nbsp;aestdtc numeric should solve the problem. So this code will create a numeric variable named aestdc, and since both aendt and aestdtc are numeric dates, they can be compared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1;
    set test(rename=(aestdc=old_aestdc));
    aestdc=input(old_aestdc,yymmdd10.); /* the new aestdc in a numeric date */
run;
    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now that both are dates, the comparisons should work. This code seems to do what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set test1;
    prev_ae=lag(ae);
    prev_aendt=lag(aendt);
    prev_aestdtc=lag(aestdtc);
    format prev_aendt prev_aestdtc date9.;
    /* Compare dates of adjacent observations, if they don't overlap then add 1 to JOIN */
    if not (aendt&amp;lt;=prev_aendt and aestdtc&amp;gt;=prev_aestdtc) or ae^=prev_ae then join+1;
    drop prev_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jun 2025 12:04:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2025-06-25T12:04:27Z</dc:date>
    <item>
      <title>Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969654#M376907</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I have to create&amp;nbsp;&lt;STRONG&gt;join&amp;nbsp;&lt;/STRONG&gt;variable and &lt;STRONG&gt;astdt&lt;/STRONG&gt; variable (as shown in the dataset), &lt;STRONG&gt;JOIN&lt;/STRONG&gt; variable for each USUBJID and AE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ASTDT is date9. Format for AESTDTC variable.&lt;/P&gt;
&lt;P&gt;To check the set of observation with overlapping AEs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For eg. if you see &amp;nbsp;5&lt;SUP&gt;th&lt;/SUP&gt; observation Neutropenia, this observation fall in between previous observation of Neutropenia (ie. aestdtc = 2025-01-27 is in between previous observation (Neutropenia&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aestdtc = 2025-01-06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aendt=07FEB2025)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which is why it is considered as same event with JOIN = 4 for both 4&lt;SUP&gt;th&lt;/SUP&gt; and 5&lt;SUP&gt;th&lt;/SUP&gt; observation.&lt;/P&gt;
&lt;P&gt;And the ASTDT is same as previous one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please help me do &amp;nbsp;programmatically.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also paste the datalines for the test dataset (input dataset).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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-1750846860760.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107984i6DD9A721DE2D7925/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abhinayingole_0-1750846860760.png" alt="abhinayingole_0-1750846860760.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data test;
    infile datalines dlm='09'x dsd truncover;
    informat   aendt date9.;
    input usubjid :$3. aestdtc :$10.   aendt :date9. ae :$200.;
    format   aendt date9.;
datalines;
101	2024-12-18	28JAN25	Appetite lost
101	2024-12-19	26DEC24	Constipation
101	2024-12-30	10FEB25	Thrombopenia
101	2025-01-06	07FEB25	Neutropenia
101	2025-01-27	07FEB25	Neutropenia
101	2025-01-13	23MAR25	Anemia
101	2025-02-10	23MAR25	Anemia
101	2025-01-25	10FEB25	Dizziness
101	2025-01-25	10FEB25	Dyspnea
101	2025-01-25	.	Fatigue
101	2025-01-27	31JAN25	Nausea
101	2025-01-27	31JAN25	WBC decreased
101	2025-02-03	15FEB25	Rhinitis
101	2025-03-01	.	Epigastralgia
101	2025-03-01	03MAR25	Nausea
101	2025-03-01	03MAR25	Vomiting
101	2025-03-24	.	Anemia
101	2025-03-24	.	Thrombopenia
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 10:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969654#M376907</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-25T10:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969655#M376908</link>
      <description>&lt;P&gt;In order to make this work, you cannot have&amp;nbsp;aestdtc as a "character date" and aendt as a numeric date, since SAS does not know how to compare character strings to numbers. Making&amp;nbsp;aestdtc numeric should solve the problem. So this code will create a numeric variable named aestdc, and since both aendt and aestdtc are numeric dates, they can be compared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1;
    set test(rename=(aestdc=old_aestdc));
    aestdc=input(old_aestdc,yymmdd10.); /* the new aestdc in a numeric date */
run;
    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now that both are dates, the comparisons should work. This code seems to do what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set test1;
    prev_ae=lag(ae);
    prev_aendt=lag(aendt);
    prev_aestdtc=lag(aestdtc);
    format prev_aendt prev_aestdtc date9.;
    /* Compare dates of adjacent observations, if they don't overlap then add 1 to JOIN */
    if not (aendt&amp;lt;=prev_aendt and aestdtc&amp;gt;=prev_aestdtc) or ae^=prev_ae then join+1;
    drop prev_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 12:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969655#M376908</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-25T12:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969656#M376909</link>
      <description>&lt;P&gt;This will not work as I require result per USUBJID and I want AESTDTC as character in final dataset (as in input itself)&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 12:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969656#M376909</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-25T12:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969659#M376910</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set test1;
    by usubjid;
    prev_ae=lag(ae);
    prev_aendt=lag(aendt);
    prev_aestdtc=lag(aestdtc);
    format prev_aendt prev_aestdtc date9.;
    /* Compare dates of adjacent observations, if they don't overlap then add 1 to JOIN */
    if first.usubjid then join=0;
    if not (aendt&amp;lt;=prev_aendt and aestdtc&amp;gt;=prev_aestdtc) or ae^=prev_ae then join+1;
    drop prev_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need&amp;nbsp;&lt;SPAN&gt;AESTDTC as character, simply modify my code to so you don't rename AESTDTC (so it leaves AESTDTC unchanged as character) and create a new variable for the numeric SAS date .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 13:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969659#M376910</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-25T13:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969661#M376911</link>
      <description>&lt;P&gt;still it is not working .... i am getting below result in this case&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-1750857761243.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107985iC8781AB97DA098E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abhinayingole_0-1750857761243.png" alt="abhinayingole_0-1750857761243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 13:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969661#M376911</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-25T13:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969663#M376912</link>
      <description>&lt;P&gt;I can't read your mind. Please tell us, in words, what is wrong. Also, please show us the code you used that doesn't produce the right results.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 13:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969663#M376912</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-25T13:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969669#M376913</link>
      <description>&lt;P&gt;If I understand your request correctly, then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    infile datalines truncover;
    input usubjid $3. aestdtc :$10. @17 aendt date7. ae &amp;amp; :$200.;
    format   aendt date9.;
datalines;
101 2024-12-18  28JAN25 Appetite lost
101 2024-12-19  26DEC24 Constipation
101 2024-12-30  10FEB25 Thrombopenia
101 2025-01-06  07FEB25 Neutropenia
101 2025-01-27  07FEB25 Neutropenia
101 2025-01-13  23MAR25 Anemia
101 2025-02-10  23MAR25 Anemia
101 2025-01-25  10FEB25 Dizziness
101 2025-01-25  10FEB25 Dyspnea
101 2025-01-25  .       Fatigue
101 2025-01-27  31JAN25 Nausea
101 2025-01-27  31JAN25 WBC decreased
101 2025-02-03  15FEB25 Rhinitis
101 2025-03-01  .       Epigastralgia
101 2025-03-01  03MAR25 Nausea
101 2025-03-01  03MAR25 Vomiting
101 2025-03-24  .       Anemia
101 2025-03-24  .       Thrombopenia
run;

DATA WANT;
  SET test;
  by usubjid ae notsorted;
  astdt=input(aestdtc,yymmdd10.);
  format astdt date9.;
  if astdt&amp;gt;lag(aendt) or first.ae=1 then join+1;
  if first.usubjid=1 then join=1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do you have instances of a given AE qualifying to be assigned the same JOIN value, but occurring in non-consecutive observations?&amp;nbsp; If so, this code would need to be modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the BY statement allows detection of whenever a new AE description occurs (first.ae=1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please provide your sample data in a &lt;EM&gt;&lt;STRONG&gt;working data step&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp;For example, your informat of date9. for aendt should have been date7.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 14:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969669#M376913</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2025-06-25T14:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969675#M376914</link>
      <description>&lt;P&gt;Thanks Mkeintz,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with this code the JOIN values are fine but not ASTDT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for eg. for observation no. 5 I want ASTDT as 06JAN2025 as this is overlapping AE&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-1750863902309.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107989i4087F439C484DA16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abhinayingole_0-1750863902309.png" alt="abhinayingole_0-1750863902309.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could you please help me with this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 15:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969675#M376914</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-25T15:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969685#M376917</link>
      <description>Why do you think you need something as stupid as character dates?</description>
      <pubDate>Wed, 25 Jun 2025 16:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969685#M376917</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-06-25T16:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969686#M376918</link>
      <description>&lt;P&gt;ohhh, no. this code is not working .&lt;/P&gt;
&lt;P&gt;I think it requires proper sorting . if the datalines as in the below code (I just shuffle few lines as compare to previous code).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this solution is not working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    infile datalines dlm='09'x dsd truncover;
    informat   aendt date9.;
    input usubjid :$3. aestdtc :$10.   aendt :date9. ae :$200.;
    format   aendt date9.;
datalines;
101	2024-12-19	26DEC24	Constipation
101	2024-12-30	10FEB25	Thrombopenia
101	2025-01-27	07FEB25	Neutropenia
101	2025-01-13	23MAR25	Anemia
101	2025-01-25	10FEB25	Dizziness
101	2025-01-25	10FEB25	Dyspnea
101	2024-12-18	28JAN25	Appetite lost
101	2025-01-25	.	Fatigue
101	2025-02-10	23MAR25	Anemia
101	2025-01-27	31JAN25	Nausea
101	2025-01-27	31JAN25	WBC decreased
101	2025-02-03	15FEB25	Rhinitis
101	2025-03-01	.	Epigastralgia
101	2025-03-01	03MAR25	Nausea
101	2025-03-01	03MAR25	Vomiting
101	2025-01-06	07FEB25	Neutropenia
101	2025-03-24	.	Anemia
101	2025-03-24	.	Thrombopenia
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 16:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969686#M376918</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-25T16:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969690#M376920</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Also please provide your sample data in a &lt;EM&gt;&lt;STRONG&gt;working data step&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp;For example, your informat of date9. for aendt should have been date7.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually since the original posted data step is using LIST MODE input the width on the informat specification does not matter.&amp;nbsp; You seem to have converted the step to using FORMATTED MODE to read the numeric date variable, which is not necessary when missing values are represented by periods in the card images.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 17:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969690#M376920</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-25T17:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969793#M376946</link>
      <description>&lt;P&gt;Hi Kurt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;actually I wanted to present AESTDTC in ISO8601 format in my dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;sorry for any confusion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 11:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969793#M376946</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-26T11:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969794#M376947</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/411144"&gt;@abhinayingole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Kurt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;actually I wanted to present AESTDTC in ISO8601 format in my dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;sorry for any confusion.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you want to make the date numeric and use the proper ISO 8601 format (which SAS has built-in), see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/allprodslang/syntaxByCategory-format.htm#p0aa41u6lidfz1n1n977se5xgl2s" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmmvacdc/9.4/allprodslang/syntaxByCategory-format.htm#p0aa41u6lidfz1n1n977se5xgl2s&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do not want character dates.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 11:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969794#M376947</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-06-26T11:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969826#M376955</link>
      <description>Hi Kurt&lt;BR /&gt;if possible, could you please provide solution for this task</description>
      <pubDate>Fri, 27 Jun 2025 05:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969826#M376955</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2025-06-27T05:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create JOIN variable for OVERLAPPING AEs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969835#M376956</link>
      <description>&lt;P&gt;In a DATA step, use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by usubjid;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;At first.usubjid, set join to 1.&lt;/P&gt;
&lt;P&gt;If not first.usubjid, and either ae is not equal to lag(ae) or aestdtc is greater than lag(aendt), increment join by 1.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 09:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-JOIN-variable-for-OVERLAPPING-AEs/m-p/969835#M376956</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-06-27T09:53:22Z</dc:date>
    </item>
  </channel>
</rss>

