<?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 Update the value for alternate recorded date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562470#M157563</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly go through my sample dataset for the clear picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
input Id Vdate mmddyy10. visit;
format Vdate date9.;
cards;
12 10/11/2012 1
12 02/08/2013 2
12 01/09/2013 3
12 01/01/2014 4
63 05/06/2010 1
63 02/08/2010 2
63 07/11/2011 3
63 09/09/2011 4
;

data bbb;
input Id Rdate mmddyy10. BP;
format Rdate date9.;
cards;
12 10/11/2012 89
12 04/08/2013 56
12 05/09/2013 78
63 05/06/2010 45
63 06/08/2010 12
63 08/11/2011 32
63 09/09/2011 65
;

/*
OP
ID VDate    Visit	RDate	   BP
12 10/11/2012 1  	10/11/2012 89
12 02/08/2013 2		04/08/2013 56
12 01/09/2013 3		05/09/2013 78
12 01/01/2014 4		.			.
63 05/06/2010 1		05/06/2010 45
63 02/08/2010 2		06/08/2010 12
63 07/11/2011 3		08/11/2011 32
63 09/09/2011 4		09/09/2011 65
*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to update the BP value through the matched date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I updated the step where VisitDate and RecordDate are&amp;nbsp;the same.&lt;/P&gt;&lt;P&gt;But I failed to match the case where the RecordDate is &amp;gt; VisitDate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In those cases, I need to update the value of Rdate in between the Vdates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference, I placed the required OP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2019 05:54:45 GMT</pubDate>
    <dc:creator>Sathish_jammy</dc:creator>
    <dc:date>2019-05-30T05:54:45Z</dc:date>
    <item>
      <title>Update the value for alternate recorded date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562470#M157563</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly go through my sample dataset for the clear picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
input Id Vdate mmddyy10. visit;
format Vdate date9.;
cards;
12 10/11/2012 1
12 02/08/2013 2
12 01/09/2013 3
12 01/01/2014 4
63 05/06/2010 1
63 02/08/2010 2
63 07/11/2011 3
63 09/09/2011 4
;

data bbb;
input Id Rdate mmddyy10. BP;
format Rdate date9.;
cards;
12 10/11/2012 89
12 04/08/2013 56
12 05/09/2013 78
63 05/06/2010 45
63 06/08/2010 12
63 08/11/2011 32
63 09/09/2011 65
;

/*
OP
ID VDate    Visit	RDate	   BP
12 10/11/2012 1  	10/11/2012 89
12 02/08/2013 2		04/08/2013 56
12 01/09/2013 3		05/09/2013 78
12 01/01/2014 4		.			.
63 05/06/2010 1		05/06/2010 45
63 02/08/2010 2		06/08/2010 12
63 07/11/2011 3		08/11/2011 32
63 09/09/2011 4		09/09/2011 65
*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to update the BP value through the matched date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I updated the step where VisitDate and RecordDate are&amp;nbsp;the same.&lt;/P&gt;&lt;P&gt;But I failed to match the case where the RecordDate is &amp;gt; VisitDate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In those cases, I need to update the value of Rdate in between the Vdates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference, I placed the required OP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 05:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562470#M157563</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-05-30T05:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Update the value for alternate recorded date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562477#M157565</link>
      <description>&lt;P&gt;In your request, all of your&amp;nbsp;&lt;SPAN&gt;RecordDate is &amp;gt; VisitDate. What if that was not the case?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If your data is representative, you can simply do&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   call missing(BP);
   merge aaa bbb;
   by ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2019 06:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562477#M157565</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-30T06:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update the value for alternate recorded date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562488#M157572</link>
      <description>&lt;P&gt;Thanks for your quick and effective response.&lt;/P&gt;&lt;P&gt;I want to implement conditions like :&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition1 :&amp;nbsp;Vdate =&amp;nbsp;Rdate - (I done)&lt;/P&gt;&lt;P&gt;Condition 2: if Vdate &amp;lt; Rdate but that date in between its next Vdate ?????&lt;/P&gt;&lt;P&gt;I need to use these conditions as a SAS data step...&lt;/P&gt;&lt;P&gt;Sorry! if I trouble you...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried sql pattern as:&lt;/P&gt;&lt;P&gt;update ccc&lt;BR /&gt;set Rdate = b.Record_date,&lt;BR /&gt;BP = b.BloodPressure&lt;BR /&gt;FROM ccc a JOIN bbb b&lt;BR /&gt;ON a.ID = b.ID and&lt;BR /&gt;b.Rdate = a.Vdate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update ccc&lt;BR /&gt;set Rdate = b.Record_date,&lt;BR /&gt;BP = b.BloodPressure&lt;BR /&gt;FROM ccc a JOIN bbb b&lt;BR /&gt;ON a.ID = b.ID and Rdate is null and&amp;nbsp;BP is null&lt;BR /&gt;b.Rdate between (&lt;SPAN&gt;the Vdate and nxt Vdate&lt;/SPAN&gt;) ??????&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I cant specify the date here Its differs for each IDs So Please suggest to specify this condition.Thanks in adv&lt;/SPAN&gt;&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, 30 May 2019 08:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562488#M157572</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-05-30T08:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Update the value for alternate recorded date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562665#M157638</link>
      <description>&lt;P&gt;Instead of showing your program that didn't work, explain what result you would like to see and the reasoning that makes it the right result.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 19:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-the-value-for-alternate-recorded-date/m-p/562665#M157638</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-30T19:06:18Z</dc:date>
    </item>
  </channel>
</rss>

