<?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: Selecting within range in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659167#M197529</link>
    <description>Edited and noted for future reference. I thought the 'insert SAS code' window would only show up as a small window on the post with a limited number of lines (like the message you create does).  Apologies.&lt;BR /&gt;</description>
    <pubDate>Mon, 15 Jun 2020 23:44:12 GMT</pubDate>
    <dc:creator>jcis7</dc:creator>
    <dc:date>2020-06-15T23:44:12Z</dc:date>
    <item>
      <title>Selecting within range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659146#M197514</link>
      <description>&lt;P&gt;G'day!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the file below, for the variable GSS, if we're looking to find a facility that has the number 6 between the ranges for&lt;/P&gt;
&lt;P&gt;i.e, &amp;nbsp;for GSS=-8 &amp;nbsp;and&amp;nbsp;GSS=1-9, etc, we want to keep the field 'code' and 'GSS' where the span includes a 6,&lt;/P&gt;
&lt;P&gt;how would you do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, where&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;facilitycode=01100170112607&amp;#127; and GSS = 0-12&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; since GSS has a range between 0,1,2,3,4,5,6,7,8,9,10,11 and 12, &amp;nbsp;there is a 6, how do we identify this facility as one we want to keep because it has a 6 in the range into a separate dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need to do this for all the observations in the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you separate out GSS in the example above 2 variables: &amp;nbsp;GSLow=0 &amp;nbsp;GSHigh=12 &amp;nbsp;and then ask SAS to determine if there is a 6 in that span?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Any help you can give will be much appreciated!&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* --------------------------------------------------------------------

   -------------------------------------------------------------------- */


DATA WORK.'Sch gss'n;
    LENGTH
        F1               $ 14
        F2               $ 5 ;
    FORMAT
        F1               $CHAR14.
        F2               $CHAR5. ;
    INFORMAT
        F1               $CHAR14.
        F2               $CHAR5. ;
    INFILE DATALINES4
        DLM='7F'x
        MISSOVER
        DSD ;
    INPUT
        F1               : $CHAR14.
        F2               : $CHAR5. ;
DATALINES4;
FaclityCode&amp;#127;GSS
01100170112607&amp;#127;0-12
01100170123968&amp;#127;0-8
01100170124172&amp;#127;0-8
01100170125567&amp;#127;0-8
01100170129403&amp;#127;6-8
01611506090435&amp;#127;0-5
01611506090468&amp;#127;0-5
&lt;BR /&gt;;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;The&amp;nbsp;first&amp;nbsp;5&amp;nbsp;lines&amp;nbsp;of&amp;nbsp;the&amp;nbsp;dataset&amp;nbsp;above&amp;nbsp;that&amp;nbsp;have&amp;nbsp;6&amp;nbsp;in&amp;nbsp;the&amp;nbsp;span&amp;nbsp;of&amp;nbsp;GSS&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 23:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659146#M197514</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2020-06-15T23:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting within range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659149#M197517</link>
      <description>&lt;P&gt;Since you do not have a variable "GSS" in your data, only F1 and F2 you need to discuss the requirements in terms of your variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do&amp;nbsp; yourself a favor and reduce the example data to about 20 rows so you can work out the needed result by hand and show that as a "want" data set.&lt;/P&gt;
&lt;P&gt;You have pasted so many unneeded rows that the forum can't run properly .&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 22:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659149#M197517</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-15T22:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting within range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659161#M197526</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.test;
    LENGTH
        F1               $ 14
        F2               $ 5 ;
    FORMAT
        F1               $CHAR14.
        F2               $CHAR5. ;
    INFORMAT
        F1               $CHAR14.
        F2               $CHAR5. ;
    INPUT
        F1               : $CHAR14.
        F2               : $CHAR5. ;
low = input(scan(F2,1,'-'),best12.);
high= input(scan(F2,-1,'-'),best12.);
if low &amp;lt;= 6 and high &amp;gt;=6;
DATALINES4;
01100170112607 0-12
01100170123968 0-8
01100170124172 0-8
01100170125567 0-8
01100170129403 6-8
01100170130401 8-12
01100170130419 7-12
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jun 2020 22:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659161#M197526</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-06-15T22:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting within range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659165#M197528</link>
      <description>&lt;P&gt;I should have been clearer: edit your first post. This page takes entirely too long to load.&lt;/P&gt;
&lt;P&gt;You should be able to edit the content of your post by clicking on the three dots near the topic. Then delete a lot of lines.&lt;/P&gt;
&lt;P&gt;Then show what the intended result should be.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 23:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659165#M197528</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-15T23:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting within range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659167#M197529</link>
      <description>Edited and noted for future reference. I thought the 'insert SAS code' window would only show up as a small window on the post with a limited number of lines (like the message you create does).  Apologies.&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Jun 2020 23:44:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/659167#M197529</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2020-06-15T23:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting within range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/660055#M197615</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40498"&gt;@jcis7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Edited and noted for future reference. I thought the 'insert SAS code' window would only show up as a small window on the post with a limited number of lines (like the message you create does). Apologies.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Live an learn, this is the first time I had seen enough data to affect performance and was bit surprised as well. Thank you for fixing the post.&lt;/P&gt;
&lt;P&gt;The boxes will take as much as you copy apparently.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 14:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-within-range/m-p/660055#M197615</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-16T14:49:02Z</dc:date>
    </item>
  </channel>
</rss>

