<?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 Select Data between two values in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490897#M31651</link>
    <description>&lt;P&gt;Hey Guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry for my english.. i try my best &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does someone know, how to select all data from my table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;between (AE = "A" AND AE = "E")&amp;nbsp; OR between (AE = "A" AND AE = "B")&amp;nbsp;&amp;nbsp; OR&amp;nbsp; between (AE = "B" AND AE = "E") OR&amp;nbsp; between (AE = "B" AND AE = "B")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;There are As for Start, Es for End or Bs for either Start or End in the data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;I just like to select the rows between an A and an E (or A and B or B and E or even B and B) and put them in a new table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;so like: when AE is A: take all lines after (in time) until AE is E and put them in a new table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;Table is sorted by IPID and than by measurement_time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;please look at the pic attached.&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;&lt;SPAN class="comment-copy"&gt;thank you very much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;Luie&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table" style="width: 548px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22849i7878DF551E51E926/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-08-29 13_56_09-Gapfiller - SAS Enterprise Guide.png" alt="table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Aug 2018 15:51:28 GMT</pubDate>
    <dc:creator>MirLuie</dc:creator>
    <dc:date>2018-08-29T15:51:28Z</dc:date>
    <item>
      <title>Select Data between two values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490897#M31651</link>
      <description>&lt;P&gt;Hey Guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry for my english.. i try my best &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does someone know, how to select all data from my table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;between (AE = "A" AND AE = "E")&amp;nbsp; OR between (AE = "A" AND AE = "B")&amp;nbsp;&amp;nbsp; OR&amp;nbsp; between (AE = "B" AND AE = "E") OR&amp;nbsp; between (AE = "B" AND AE = "B")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;There are As for Start, Es for End or Bs for either Start or End in the data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;I just like to select the rows between an A and an E (or A and B or B and E or even B and B) and put them in a new table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;so like: when AE is A: take all lines after (in time) until AE is E and put them in a new table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;Table is sorted by IPID and than by measurement_time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;please look at the pic attached.&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;&lt;SPAN class="comment-copy"&gt;thank you very much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;Luie&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table" style="width: 548px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22849i7878DF551E51E926/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-08-29 13_56_09-Gapfiller - SAS Enterprise Guide.png" alt="table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 15:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490897#M31651</guid>
      <dc:creator>MirLuie</dc:creator>
      <dc:date>2018-08-29T15:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select Data between two values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490900#M31653</link>
      <description>&lt;P&gt;Untested; when you post a question like this, you should provide your test data in the form of a data step, so I can recreate it to try the program;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SetSwitch;
	retain KeepSwitch 0;
	set Have;

	if AE = "A" then KeepSwitch = 1;
	else if AE = "E" then KeepSwitch = 0;
	else if AE = "B" &amp;amp; KeepSwitch = 1 then KeepSwitch = 0;
	else if AE = "B" &amp;amp; KeepSwitch = 0 then KeepSwitch = 1;
run;

data SetVar;
	set SetSwitch;

	if KeepSwitch = 1 then if AE = " " then AE = lag(AE);
run;

data Want;
	set SetVar;

	if AE ^= " " then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Aug 2018 16:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490900#M31653</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-08-29T16:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select Data between two values</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490907#M31654</link>
      <description>thank you sooo much! you made my day!</description>
      <pubDate>Wed, 29 Aug 2018 16:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Select-Data-between-two-values/m-p/490907#M31654</guid>
      <dc:creator>MirLuie</dc:creator>
      <dc:date>2018-08-29T16:26:10Z</dc:date>
    </item>
  </channel>
</rss>

