<?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: Calculating number of day supply for med from start date till a particular period in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917072#M361239</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439280"&gt;@abhi309&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;you are correct when I ran the sample data I am getting the desired results when I am running the same program with the original data it is giving me different results. I copied the records first 3 patients as it is from my original data and therefore I am not understanding why I getting different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked the program twice but it is exactly the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439280"&gt;@abhi309&lt;/a&gt;&amp;nbsp;Just to make sure: You're running this code under SAS9.4 or Viya Compute and not multithreaded under Viya CAS - right?&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 02:40:01 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2024-02-21T02:40:01Z</dc:date>
    <item>
      <title>Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917055#M361230</link>
      <description>&lt;P&gt;Hello SAS Gurus,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am stuck again and need your help. I am working with prescription claims dataset and looking at adherence of a certain class of drugs in each patient. I am looking if the patients are filling this certain drug class for 84 days or more after the first fill but I also have a certain duration which is 114 days from the first prescription date (if we include the first prescription date this duration is 115 days).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data set I have:&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; First_Pres_Dt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pres_Dt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DAYS_SUPP&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30DEC2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01FEB2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11APR2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;11AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12SEP2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 11AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 19DEC2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22JAN2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 17AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14SEP2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;17AUG2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11DEC2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 04OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;04OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;04OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01NOV2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;04OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15NOV2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;04OCT2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21JAN2023&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the above dataset, if you look at ID 4, this pt. has first fill on 4th Oct 2022 and if I will add 114 days the date will be 26th Jan 2023. So this patient has to have at least 84 days of fill till 26th Jan 2023. But he is not meeting the criteria as he only has 81 days of fill (15+30+30+6), the last fill I am including only 6 days as his window is only up to 26th Jan 2023.&amp;nbsp; So pt. 4 is not meeting the criteria but rest of patients are meeting this criteria. Hope the explanation helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 22:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917055#M361230</guid>
      <dc:creator>abhi309</dc:creator>
      <dc:date>2024-02-20T22:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917061#M361231</link>
      <description>&lt;P&gt;This code does what you ask for: it counts the number of "eligible" dates filled for each ID, where the eligible date range starts at the first PRES_DT and ends 114 days after FIRST_PRES_DT.&amp;nbsp; It accommodates gaps is supply and overlaps.&amp;nbsp; It assumes data are sorted by PRES_DT within ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID First_Pres_Dt :date9. Pres_Dt :date9. DAYS_SUPP;
format First_Pres_Dt date9. Pres_Dt date9. ;
datalines;
1 10OCT2022 10OCT2022 30
1 10OCT2022 26OCT2022 30
1 10OCT2022 30DEC2022 30
1 10OCT2022 01FEB2023 30
1 10OCT2022 11APR2023 30
2 11AUG2022 11AUG2022 30
2 11AUG2022 12SEP2022 30
2 11AUG2022 19DEC2022 30
2 11AUG2022 22JAN2022 30
3 17AUG2022 17AUG2022 30
3 17AUG2022 14SEP2022 60
3 17AUG2022 11DEC2022 15
4 04OCT2022 04OCT2022 15
4 04OCT2022 01NOV2022 30
4 04OCT2022 15NOV2022 30
4 04OCT2022 21JAN2023 30
run;

data want (keep=id first_pres_dt end_of_eligible_dates eligible_days_filled total_days_supply);
  do until (last.id);
    set have;
    by id ;
    format end_of_eligible_dates supply_start supply_end date9.;

    if first.id then do;
      supply_end = pres_dt-1;
      eligible_days_filled=0;
      total_days_supply=0;
    end;
    end_of_eligible_dates=intnx('day',first_pres_dt,114);
    total_days_supply+days_supp;

    supply_start = max(supply_end+1,pres_dt);
    if supply_start &amp;lt;= end_of_eligible_dates then eligible_days_filled = eligible_days_filled +  min(days_supp,end_of_eligible_dates+1-supply_start);
    supply_end=supply_end+days_supp;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Feb 2024 00:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917061#M361231</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-02-21T00:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917063#M361232</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your response. I tried using the code you posted but it is not giving me accurate results. The final dataset has Eligible_Days_filled for pt. 1 is 1 and for pt. 2 is 0, which is not accurate.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 01:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917063#M361232</guid>
      <dc:creator>abhi309</dc:creator>
      <dc:date>2024-02-21T01:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917064#M361233</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439280"&gt;@abhi309&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your response. I tried using the code you posted but it is not giving me accurate results. The final dataset has Eligible_Days_filled for pt. 1 is 1 and for pt. 2 is 0, which is not accurate.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When I run the program I provided with the sample data you provided, included in my example, patient 1 gets 91 eligible days filled, patient 2 gets 85.&amp;nbsp; Please run the program I provided with the sample data in my response to confirm the results.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 01:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917064#M361233</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-02-21T01:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917068#M361236</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;you are correct when I ran the sample data I am getting the desired results when I am running the same program with the original data it is giving me different results. I copied the records first 3 patients as it is from my original data and therefore I am not understanding why I getting different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked the program twice but it is exactly the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 02:09:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917068#M361236</guid>
      <dc:creator>abhi309</dc:creator>
      <dc:date>2024-02-21T02:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917069#M361237</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439280"&gt;@abhi309&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;you are correct when I ran the sample data I am getting the desired results when I am running the same program with the original data it is giving me different results. I copied the records first 3 patients as it is from my original data and therefore I am not understanding why I getting different results.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the program is the same as I provided, then your original data must somehow be different than what you copied to this forum.&amp;nbsp; There can't be any other reason to get different results with the same program,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 21 Feb 2024 02:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917069#M361237</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-02-21T02:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917072#M361239</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439280"&gt;@abhi309&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;you are correct when I ran the sample data I am getting the desired results when I am running the same program with the original data it is giving me different results. I copied the records first 3 patients as it is from my original data and therefore I am not understanding why I getting different results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked the program twice but it is exactly the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439280"&gt;@abhi309&lt;/a&gt;&amp;nbsp;Just to make sure: You're running this code under SAS9.4 or Viya Compute and not multithreaded under Viya CAS - right?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 02:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917072#M361239</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-21T02:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of day supply for med from start date till a particular period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917076#M361241</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the confusion and thank you again for the solution. I was using the dataset which was not sorted and that is why getting different results.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 02:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-number-of-day-supply-for-med-from-start-date-till-a/m-p/917076#M361241</guid>
      <dc:creator>abhi309</dc:creator>
      <dc:date>2024-02-21T02:57:09Z</dc:date>
    </item>
  </channel>
</rss>

