<?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: create daily dose records from a exposure doses period in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-daily-dose-records-from-a-exposure-doses-period/m-p/798631#M313968</link>
    <description>&lt;P&gt;Not sure what you gain by having two identical values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one way if your dates are actually SAS date values.&lt;/P&gt;
&lt;PRE&gt;data have;
   input subject $ start :date9. stop :date9.;
   format start stop date9.;
datalines;
1001 10jun2021 17jun2021
1001  18jun2021  25jun2021
1001   26jun2021  02jul2021
1002  02feb2021  10feb2021
1002  11feb2021  3mar2021
1002   04mar2021 07mar2021
1003   10dec2021 15dec2021
1003   16dec2021  28dec2021
1003   29dec2021  05jan2022
;

data want;
  set have;
  do daily=start to stop;
     output;
  end;
  format daily date9.;
run;
&lt;/PRE&gt;
&lt;P&gt;Please note the use of data step code that can run to create a SAS data set to work with. The second data step adds a variable for every day of the start/stop periods. You could drop Start and stop if not wanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2022 16:28:48 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-02-25T16:28:48Z</dc:date>
    <item>
      <title>create daily dose records from a exposure doses period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-daily-dose-records-from-a-exposure-doses-period/m-p/798616#M313965</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you can help me with this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 3 subjects: 1001, 1002 and 1003&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Taking daily doses this periods of days:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;subject start&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stop&lt;/P&gt;
&lt;P&gt;1001. 10jun2021 17jun2021&lt;/P&gt;
&lt;P&gt;1001&amp;nbsp; 18jun2021&amp;nbsp; 25jun2021&lt;/P&gt;
&lt;P&gt;1001&amp;nbsp; &amp;nbsp;26jun2021&amp;nbsp; 02jul2021&lt;/P&gt;
&lt;P&gt;1002&amp;nbsp; 02feb2021&amp;nbsp; 10feb2021&lt;/P&gt;
&lt;P&gt;1002&amp;nbsp; 11feb2021&amp;nbsp; 3mar2021&lt;/P&gt;
&lt;P&gt;1002&amp;nbsp; &amp;nbsp;04mar2021 07mar2021&lt;/P&gt;
&lt;P&gt;1003&amp;nbsp; &amp;nbsp;10dec2021 15dec2021&lt;/P&gt;
&lt;P&gt;1003&amp;nbsp; &amp;nbsp;16dec2021&amp;nbsp; 28dec2021&lt;/P&gt;
&lt;P&gt;1003.&amp;nbsp; &amp;nbsp;29dec2021&amp;nbsp; 05jan2022&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to create a dataset with daily records from the start de dose (start firs record=10jun2021) to the end of the dose (stop last record=02jul2021)...example for subject 1001&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;same for the other subjects...something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1001 10jun2021 10jun2021&lt;/P&gt;
&lt;P&gt;1001 11jun2021. 11jun2021&lt;/P&gt;
&lt;P&gt;1001 12jun2021 12jun2021&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;1001 02jul2021 02jul2021&lt;/P&gt;
&lt;P&gt;1002&amp;nbsp; 02eb2021 02feb2021&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;1002&amp;nbsp; 07mar2021 07mar2021&lt;/P&gt;
&lt;P&gt;1003 10dec2021 10dec2021&lt;/P&gt;
&lt;P&gt;1003 ...&lt;/P&gt;
&lt;P&gt;1003 05jan2022 05jan2022&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will be great if you can help me to generate these daily records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cuan&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 15:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-daily-dose-records-from-a-exposure-doses-period/m-p/798616#M313965</guid>
      <dc:creator>cuan</dc:creator>
      <dc:date>2022-02-25T15:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: create daily dose records from a exposure doses period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-daily-dose-records-from-a-exposure-doses-period/m-p/798631#M313968</link>
      <description>&lt;P&gt;Not sure what you gain by having two identical values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one way if your dates are actually SAS date values.&lt;/P&gt;
&lt;PRE&gt;data have;
   input subject $ start :date9. stop :date9.;
   format start stop date9.;
datalines;
1001 10jun2021 17jun2021
1001  18jun2021  25jun2021
1001   26jun2021  02jul2021
1002  02feb2021  10feb2021
1002  11feb2021  3mar2021
1002   04mar2021 07mar2021
1003   10dec2021 15dec2021
1003   16dec2021  28dec2021
1003   29dec2021  05jan2022
;

data want;
  set have;
  do daily=start to stop;
     output;
  end;
  format daily date9.;
run;
&lt;/PRE&gt;
&lt;P&gt;Please note the use of data step code that can run to create a SAS data set to work with. The second data step adds a variable for every day of the start/stop periods. You could drop Start and stop if not wanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 16:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-daily-dose-records-from-a-exposure-doses-period/m-p/798631#M313968</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-25T16:28:48Z</dc:date>
    </item>
  </channel>
</rss>

