<?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: How to get the rows having the minimum value of a variable if the minimum falls below a certain in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715967#M221197</link>
    <description>No there is no missing value in the data and only one row for each student</description>
    <pubDate>Tue, 02 Feb 2021 06:58:31 GMT</pubDate>
    <dc:creator>Shradha1</dc:creator>
    <dc:date>2021-02-02T06:58:31Z</dc:date>
    <item>
      <title>How to get the rows having the minimum value of a variable if the minimum falls below a certain rang</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715955#M221191</link>
      <description>&lt;P&gt;I have a dataset with student names and their scores on different subject:&lt;/P&gt;
&lt;P&gt;student a1 a2 a3 a4&lt;BR /&gt;jim 500 0 675 342&lt;BR /&gt;mary 345 45 876 510&lt;BR /&gt;mark 234 345 100 200&lt;BR /&gt;suzy 768 230 56 768&lt;/P&gt;
&lt;P&gt;If the minimum score for any subject lies within 0-100(both values included) then I want to a flag for all those rows for that subject. If the minimum is higher than 100 then I want a flag only for the row with the minimum value. For example the resulting dataset will look like this:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 432pt;" border="0" width="576" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;student&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;a1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;a2&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;a3&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;a4&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;flag_a1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;flag_a2&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;flag_a3&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;flag_a4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;jim&lt;/TD&gt;
&lt;TD align="right"&gt;500&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;675&lt;/TD&gt;
&lt;TD align="right"&gt;342&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD align="right"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;mary&lt;/TD&gt;
&lt;TD align="right"&gt;345&lt;/TD&gt;
&lt;TD align="right"&gt;45&lt;/TD&gt;
&lt;TD align="right"&gt;876&lt;/TD&gt;
&lt;TD align="right"&gt;510&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;mark&lt;/TD&gt;
&lt;TD align="right"&gt;234&lt;/TD&gt;
&lt;TD align="right"&gt;345&lt;/TD&gt;
&lt;TD align="right"&gt;100&lt;/TD&gt;
&lt;TD align="right"&gt;200&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;suzy&lt;/TD&gt;
&lt;TD align="right"&gt;768&lt;/TD&gt;
&lt;TD align="right"&gt;230&lt;/TD&gt;
&lt;TD align="right"&gt;56&lt;/TD&gt;
&lt;TD align="right"&gt;768&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lastly I want to filter out all the rows with flag =1:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;student&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;flag_a1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;flag_a2&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;flag_a3&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;flag_a4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;jim&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;mary&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;mark&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;suzy&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" align="right" class="xl63" style="width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Any help would be great. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 07:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715955#M221191</guid>
      <dc:creator>Shradha1</dc:creator>
      <dc:date>2021-02-02T07:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715957#M221192</link>
      <description>&lt;P&gt;Why is&amp;nbsp;&lt;SPAN&gt;flag_a3 flagged in obs 2?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 05:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715957#M221192</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-02T05:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715959#M221193</link>
      <description>Sorry that was a mistake on my part. Have rectified the error</description>
      <pubDate>Tue, 02 Feb 2021 05:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715959#M221193</guid>
      <dc:creator>Shradha1</dc:creator>
      <dc:date>2021-02-02T05:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715960#M221194</link>
      <description>&lt;P&gt;Ok. What about obs 3 and 4? Why only one flag?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please be very specific about your logic &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 05:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715960#M221194</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-02T05:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715961#M221195</link>
      <description>&lt;P&gt;You need to explain this:&lt;/P&gt;
&lt;P&gt;If the minimum is higher than 100 then I want a flag only for the row with the minimum value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or at least provide an example of which of these is getting flagged from this rule.&lt;/P&gt;
&lt;P&gt;Do you have more than one row for a student in this this data? If so then you need to state so and provide an example of the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some other things to consider:&lt;/P&gt;
&lt;P&gt;Are any of the scores missing?&lt;/P&gt;
&lt;P&gt;Do you want to consider missing as something to be flagged?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it might not hurt to explain how those flags are to be used later. Sometimes it is a very good idea for "flags" to be coded 1/0. For example if you have the flags for Flag_a1 coded only as 1 if you want to determine something like "what percent of students had A1 flagged" you need to do a couple of steps because you don't have any easy to find "not flagged" information. But if the flag is 1/0 coded you can use any procedure, such as Means, Summary, Report or Tabulate that will calculate mean as the mean of 1/0 coded value is the percent of ones. Sum gives you the number of ones, or flags, if needed.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 06:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715961#M221195</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-02T06:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715967#M221197</link>
      <description>No there is no missing value in the data and only one row for each student</description>
      <pubDate>Tue, 02 Feb 2021 06:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715967#M221197</guid>
      <dc:creator>Shradha1</dc:creator>
      <dc:date>2021-02-02T06:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715968#M221198</link>
      <description>Please have a look at the updated question</description>
      <pubDate>Tue, 02 Feb 2021 07:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/715968#M221198</guid>
      <dc:creator>Shradha1</dc:creator>
      <dc:date>2021-02-02T07:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the rows having the minimum value of a variable if the minimum falls below a certain</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/716093#M221250</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/361528"&gt;@Shradha1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;No there is no missing value in the data and only one row for each student&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then this statement is basically meaningless:&lt;BR /&gt;If the minimum is higher than 100 then I want a flag only for the row with the minimum value&lt;/P&gt;
&lt;P&gt;if there is only one row per student as there is only one row and &lt;STRONG&gt;every&lt;/STRONG&gt; row has "the minimum value"&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 15:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-rows-having-the-minimum-value-of-a-variable-if/m-p/716093#M221250</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-02T15:07:57Z</dc:date>
    </item>
  </channel>
</rss>

