<?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: Splitting datasets using the records in datasets as condition? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118589#M32718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot DBailey the code is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated with the immediate solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2013 18:53:24 GMT</pubDate>
    <dc:creator>HariPrasad</dc:creator>
    <dc:date>2013-04-24T18:53:24Z</dc:date>
    <item>
      <title>Splitting datasets using the records in datasets as condition?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118587#M32716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to this forum and struggling with this query most of the SAS experts weren't able to provide me a solution yet. Any help will certainly be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: Assuming a dataset with only variable - Dummy_records which has data in chunks.&lt;/P&gt;&lt;P&gt;What i would like here is the datasets has to be split in to two and condition is the special observation in them - From the below table&lt;/P&gt;&lt;P&gt;Dataset 1 should have the records John, Joseph, Mark &amp;amp; Antony (pulling the records between CMSTART &amp;amp; CMEND)&lt;/P&gt;&lt;P&gt;Dataset 2 must have records between CISTART &amp;amp;&amp;nbsp; CIEND (Mike, Amy &amp;amp; Abel) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 100%; BORDER-TOP: #000000 1px solid; BORDER-RIGHT: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Dummy_records&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;CMSTART&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Joseph&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Mark&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Antony&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;CMEND&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;&lt;STRONG&gt;CISTART&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Amy&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Abel&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;CIEND&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probable approach i could think of -&lt;/P&gt;&lt;P&gt;1. A condtion such as &lt;STRONG&gt;between&lt;/STRONG&gt; in SQL which could wokr for text strings (if exists)&lt;/P&gt;&lt;P&gt;2. Insert a flag&amp;nbsp; to differeniate CM records and CI records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if anymore information is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hari Prasad&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 14:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118587#M32716</guid>
      <dc:creator>HariPrasad</dc:creator>
      <dc:date>2013-04-24T14:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting datasets using the records in datasets as condition?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118588#M32717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data DS1 DS2;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;retain key;&lt;/P&gt;&lt;P&gt;if dummy_record = 'CMSTART' then key='CMSTART';&lt;/P&gt;&lt;P&gt;else if dummy_record='CMEND' then key='';&lt;/P&gt;&lt;P&gt;else if dummy_record='CISTART' the key='CISTART';&lt;/P&gt;&lt;P&gt;else if dummy_record='CIEND' then key='';&lt;/P&gt;&lt;P&gt;else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if key='CMSTART' then output ds1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if key='CISTART' then output ds2;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 14:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118588#M32717</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-04-24T14:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting datasets using the records in datasets as condition?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118589#M32718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot DBailey the code is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated with the immediate solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 18:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-datasets-using-the-records-in-datasets-as-condition/m-p/118589#M32718</guid>
      <dc:creator>HariPrasad</dc:creator>
      <dc:date>2013-04-24T18:53:24Z</dc:date>
    </item>
  </channel>
</rss>

