<?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: RFPENDTC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899892#M355649</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;looks like you got a mistake in the derivation you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SDTMIG says:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RFPENDTC=Date/time when subject ended participation or follow-up in a trial, as defined in the protocol, in ISO 8601&lt;BR /&gt;character format. Should correspond to the last known date of contact. Examples include completion date,&lt;BR /&gt;withdrawal date, last follow-up, date recorded for lost to follow up, and death date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The date of the last column is not the latest date in your dataset and your lastdt seems to be erroneously derived.&lt;/P&gt;
&lt;P&gt;In fact your whole dataset is erroneous since even your start date is after your end date&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set sdtm;
   wantRFPENTC=coalesce(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
   CorrectRFPENDTC=max(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
   format wantRFPENTC CorrectRFPENDTC ddmmyy10.;
   keep id wantRFPENTC CorrectRFPENDTC ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2023 08:39:40 GMT</pubDate>
    <dc:creator>Oligolas</dc:creator>
    <dc:date>2023-10-25T08:39:40Z</dc:date>
    <item>
      <title>RFPENDTC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899873#M355645</link>
      <description>&lt;P&gt;data sdtm;&lt;BR /&gt;infile cards missover ;&lt;BR /&gt;input id RFICDTC :ddmmyy10. RFSTDTC :ddmmyy10. RFENDTC :ddmmyy10. FUMTC :ddmmyy10. lastdt:ddmmyy10.;&lt;BR /&gt;format RFICDTC RFSTDTC RFENDTC FUMTC ddmmyy10.;&lt;BR /&gt;CARDS;&lt;BR /&gt;101 08/02/1990 10/02/1991 12/05/1990 25/04/1990 25/10/1990&lt;BR /&gt;102 08/02/1990 10/02/1991 12/05/1990 &lt;BR /&gt;103 08/02/1990 10/02/1991 12/05/1990 25/04/1990 &lt;BR /&gt;104 08/02/1990 10/02/1991 &lt;BR /&gt;105 08/02/1990 10/02/1991 12/05/2020 08/02/1990 20/10/1990&lt;BR /&gt;106 08/02/1990 10/02/1991 12/05/1990 25/04/1990 &lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;I need output was below mentioned :&lt;/P&gt;
&lt;P&gt;ID RFPENDTC&lt;BR /&gt;101 25/10/1990&lt;BR /&gt;102 12/05/1990&lt;BR /&gt;103 25/04/1990&lt;BR /&gt;104 10/02/1991&lt;BR /&gt;105 20/10/1990&lt;BR /&gt;106 25/04/1990&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 05:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899873#M355645</guid>
      <dc:creator>112211</dc:creator>
      <dc:date>2023-10-25T05:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: RFPENDTC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899876#M355647</link>
      <description>&lt;P&gt;What is the rule for building your target date?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 06:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899876#M355647</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-25T06:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: RFPENDTC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899880#M355648</link>
      <description>&lt;P&gt;Telling us the selection rule would help.... By deducing what you shared it looks like you want to pick the last non-missing date based on the order of your date variables in the pdv. Below code is doing just that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sdtm;
  infile cards missover;
  input id RFICDTC :ddmmyy10. RFSTDTC :ddmmyy10. RFENDTC :ddmmyy10. FUMTC :ddmmyy10. lastdt:ddmmyy10.;
  format RFICDTC RFSTDTC RFENDTC FUMTC lastdt ddmmyy10.;
  CARDS;
101 08/02/1990 10/02/1991 12/05/1990 25/04/1990 25/10/1990
102 08/02/1990 10/02/1991 12/05/1990
103 08/02/1990 10/02/1991 12/05/1990 25/04/1990
104 08/02/1990 10/02/1991
105 08/02/1990 10/02/1991 12/05/2020 08/02/1990 20/10/1990
106 08/02/1990 10/02/1991 12/05/1990 25/04/1990
;
RUN;

data want;
  set sdtm;
  format rfpendtc ddmmyy10.;
  rfpendtc=coalesce(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1698215027541.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89067i9FC56D72AB431226/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1698215027541.png" alt="Patrick_0-1698215027541.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 06:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899880#M355648</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-25T06:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: RFPENDTC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899892#M355649</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;looks like you got a mistake in the derivation you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SDTMIG says:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RFPENDTC=Date/time when subject ended participation or follow-up in a trial, as defined in the protocol, in ISO 8601&lt;BR /&gt;character format. Should correspond to the last known date of contact. Examples include completion date,&lt;BR /&gt;withdrawal date, last follow-up, date recorded for lost to follow up, and death date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The date of the last column is not the latest date in your dataset and your lastdt seems to be erroneously derived.&lt;/P&gt;
&lt;P&gt;In fact your whole dataset is erroneous since even your start date is after your end date&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set sdtm;
   wantRFPENTC=coalesce(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
   CorrectRFPENDTC=max(lastdt,FUMTC,RFENDTC,RFSTDTC,RFICDTC);
   format wantRFPENTC CorrectRFPENDTC ddmmyy10.;
   keep id wantRFPENTC CorrectRFPENDTC ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 08:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RFPENDTC/m-p/899892#M355649</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2023-10-25T08:39:40Z</dc:date>
    </item>
  </channel>
</rss>

