<?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 Split records based on group date ranges in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890728#M351955</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to split the record based on a group of date ranges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In picture 2 ATRT='&lt;SPAN&gt;TENOFOVIR ALAFENAMIDE (TAF)' record ASTDT and AENDT dates fall into two phases from picture 1 ,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so i need to make new records as in picture 3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know ho to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Raja.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 15:21:29 GMT</pubDate>
    <dc:creator>raja777pharma</dc:creator>
    <dc:date>2023-08-24T15:21:29Z</dc:date>
    <item>
      <title>Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890728#M351955</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to split the record based on a group of date ranges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In picture 2 ATRT='&lt;SPAN&gt;TENOFOVIR ALAFENAMIDE (TAF)' record ASTDT and AENDT dates fall into two phases from picture 1 ,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so i need to make new records as in picture 3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know ho to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Raja.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890728#M351955</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2023-08-24T15:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890733#M351958</link>
      <description>&lt;P&gt;Please provide data as working SAS data step code, as you did in a &lt;A href="https://communities.sas.com/t5/SAS-Programming/how-to-remove-leading-and-traling-space-inside-brackets/m-p/796611" target="_self"&gt;previous thread&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 12:01:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890733#M351958</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-24T12:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890741#M351965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below is the CSV data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture1 data:&lt;/P&gt;&lt;P&gt;USUBJID,APHASE1,APHASE2,APHASE3,APHASE4,PH1SDT,PH1EDT,PH2SDT,PH2EDT,PH3SDT,PH3EDT,PH4SDT,PH4EDT&lt;BR /&gt;73763989HPB2003-100004,Screening,Open-label,Follow-up,,25MAR2021,19APR2021,20APR2021,21MAR2022,22MAR2022,16FEB2023,,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picture2 data:&lt;/P&gt;&lt;P&gt;USUBJID,EXLNKID,AOCCUR,ATRT,ADOSE,ASTDT,AENDT,AVISITN,APHASE,APHASEN&lt;BR /&gt;73763989HPB2003-100004,NA-20211102T1040,Y,TENOFOVIR ALAFENAMIDE (TAF),25,02NOV2021,16FEB2023,28,Open-label,2&lt;BR /&gt;73763989HPB2003-100004,NA-20210420T1045,Y,TENOFOVIR DISOPROXIL (TD),245,20APR2021,01NOV2021,0,Open-label,2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 12:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890741#M351965</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2023-08-24T12:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890743#M351967</link>
      <description>&lt;P&gt;We need data as SAS data step code, as in the other thread you wrote that I linked to.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 12:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890743#M351967</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-24T12:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890749#M351971</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Please let me know how i can create sas code with data values by using&lt;/P&gt;&lt;P&gt;CSV file data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Raja.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 13:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890749#M351971</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2023-08-24T13:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890752#M351972</link>
      <description>&lt;P&gt;You already have the data in SAS, I know this because you showed us screen captures of data in SAS. You work from the SAS data set, not from a CSV file.&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;Here&lt;/A&gt; are examples of what SAS data step code looks like and instructions on how to create such code.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 13:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890752#M351972</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-24T13:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890761#M351977</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for code.&lt;/P&gt;&lt;P&gt;Here is the&amp;nbsp; data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data picture2;
  infile datalines dsd truncover;
  input USUBJID:$60. EXLNKID:$30. AOCCUR:$1. ATRT:$200. ADOSE:32. ASTDT:DATE9. AENDT:DATE9. AVISITN:32. APHASE:$40. APHASEN:32.;
  format ASTDT DATE9. AENDT DATE9.;
  label USUBJID="Unique Subject Identifier" EXLNKID="Link ID";
datalines4;
73763989HPB2003-100004,NA-20211102T1040,Y,TENOFOVIR ALAFENAMIDE (TAF),25,02NOV2021,16FEB2023,28,Open-label,2
73763989HPB2003-100004,NA-20210420T1045,Y,TENOFOVIR DISOPROXIL (TD),245,20APR2021,01NOV2021,0,Open-label,2
;;;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data picture1;
  infile datalines dsd truncover;
  input USUBJID:$60. APHASE1:$9. APHASE2:$10. APHASE3:$9. APHASE4:$6. PH1SDT:DATE9. PH1EDT:DATE9. PH2SDT:DATE9. PH2EDT:DATE9. PH3SDT:DATE9. PH3EDT:DATE9. PH4SDT:DATE9. PH4EDT:DATE9.;
  format PH1SDT DATE9. PH1EDT DATE9. PH2SDT DATE9. PH2EDT DATE9. PH3SDT DATE9. PH3EDT DATE9. PH4SDT DATE9. PH4EDT DATE9.;
  label USUBJID="Unique Subject Identifier" APHASE1="Description of Phase 1" APHASE2="Description of Phase 2" APHASE3="Description of Phase 3" APHASE4="Description of Phase 4" PH1SDT="Phase 1 Start Date" PH1EDT="Phase 1 End Date" PH2SDT="Phase 2 Start Date" PH2EDT="Phase 2 End Date" PH3SDT="Phase 3 Start Date" PH3EDT="Phase 3 End Date" PH4SDT="Phase 4 Start Date" PH4EDT="Phase 4 End Date";
datalines4;
73763989HPB2003-100004,Screening,Open-label,Follow-up,,25MAR2021,19APR2021,20APR2021,21MAR2022,22MAR2022,16FEB2023,,
;;;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890761#M351977</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2023-08-24T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890762#M351978</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309000"&gt;@raja777pharma&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to split the record based on a group of date ranges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In picture 2 ATRT='&lt;SPAN&gt;TENOFOVIR ALAFENAMIDE (TAF)' record ASTDT and AENDT dates fall into two phases from picture 1 ,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;so i need to make new records as in picture 3.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You really need to make sure that your question makes some sense in terms of provided "data". You picuter 1 does not show any variable named ASTDT or AENDT. So there is no way we can interpret that request clearly. You actually don't even mention how Picture 1 comes into the process at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Provide rules, not pictures. Computers run on rules and without a clearly defined set of rules on how to do something then a proposed solution that works ONLY for the shown data maybe provided but would not work for more of a caste.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890762#M351978</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-24T14:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Split records based on group date ranges</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890765#M351980</link>
      <description>&lt;P&gt;Ok, very good. But now I don't understand the logic, how do you know that the ASTDT = 02NOV2021 and AENDT=16FEB2023 in picture 2 is split in the output into two rows with the dates shown, one row being 02NOV2021 to 21MAR2022 and the next row being 22MAR2022 to 16FEB2023?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-records-based-on-group-date-ranges/m-p/890765#M351980</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-24T14:29:56Z</dc:date>
    </item>
  </channel>
</rss>

