<?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 min  value in this condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648159#M194100</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for the reply!&lt;/P&gt;
&lt;P&gt;I might not state my question clearly. As in the table below, "want" column is what I wanted based on the first two columns. Basically if SScore=200, "want" will take the smallest number(integer value) in the "SScore_se" column.&amp;nbsp; How should I get that?&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;SScore_se&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;SScore&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;want&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;165.1214&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;119.3441&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;88.05075&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Fri, 15 May 2020 20:47:04 GMT</pubDate>
    <dc:creator>superbug</dc:creator>
    <dc:date>2020-05-15T20:47:04Z</dc:date>
    <item>
      <title>How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648142#M194087</link>
      <description>&lt;P&gt;I have data as in the attached.&lt;/P&gt;
&lt;P&gt;When sscore=200, I want the sscore_sem=88, which is the smallest number of s_score_se (take integer) when sscore=200.&lt;/P&gt;
&lt;P&gt;When sscore=800, I want sscore_sem=86, which is the smallest number of s_score_se (take integer) when sscore=800.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when 200&amp;lt;sscore&amp;lt;800, I want sscore_sem=INT(s_score_se).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following SAS code does not work for sscore=200 or sscore=800 conditions. please help. thanks!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data try1;&lt;BR /&gt;set try;&lt;BR /&gt;if SScore=200 then SScore_SEM=INT(MIN(S_Score_se));&lt;BR /&gt;else if SScore=800 then SScore_SEM=INT(MIN(S_score_se));&lt;BR /&gt;else if 200 &amp;lt;SScore &amp;lt;800 then SScore_SEM=INT(S_Score_se);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 19:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648142#M194087</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-05-15T19:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648146#M194089</link>
      <description>&lt;P&gt;MIN() works on a single row only.&lt;/P&gt;
&lt;P&gt;If you want summary statistics by group, create a grouping variable and then use PROC MEANS instead. or PROC SQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data try1;
set try;

if SScore=200 then SScore_SEM="200";
else if SScore=800 then SScore_SEM="800";
else if 200 &amp;lt;SScore &amp;lt;800 then SScore_SEM="200 to 800";
else SScore_SEM="CHECK ME" ;

run;

proc freq data=try1;
table sscore_sem;
run;

proc means data=try1 N SUM MIN;
class sscore_sem;
var s_score_se;
output out=want min=min_value;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have data as in the attached.&lt;/P&gt;
&lt;P&gt;When sscore=200, I want the sscore_sem=88, which is the smallest number of s_score_se (take integer) when sscore=200.&lt;/P&gt;
&lt;P&gt;When sscore=800, I want sscore_sem=86, which is the smallest number of s_score_se (take integer) when sscore=800.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when 200&amp;lt;sscore&amp;lt;800, I want sscore_sem=INT(s_score_se).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following SAS code does not work for sscore=200 or sscore=800 conditions. please help. thanks!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data try1;&lt;BR /&gt;set try;&lt;BR /&gt;if SScore=200 then SScore_SEM=INT(MIN(S_Score_se));&lt;BR /&gt;else if SScore=800 then SScore_SEM=INT(MIN(S_score_se));&lt;BR /&gt;else if 200 &amp;lt;SScore &amp;lt;800 then SScore_SEM=INT(S_Score_se);&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648146#M194089</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-15T21:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648155#M194096</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp;Following&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;'s shoes, you could consider defining formats and do proc summary using formatted values as groups in the class statement. Well, up to you!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 20:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648155#M194096</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T20:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648158#M194099</link>
      <description>&lt;P&gt;Formats are definitely a more efficient approach in this case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 20:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648158#M194099</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-15T20:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648159#M194100</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for the reply!&lt;/P&gt;
&lt;P&gt;I might not state my question clearly. As in the table below, "want" column is what I wanted based on the first two columns. Basically if SScore=200, "want" will take the smallest number(integer value) in the "SScore_se" column.&amp;nbsp; How should I get that?&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;SScore_se&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;SScore&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;want&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;165.1214&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;119.3441&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;88.05075&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 15 May 2020 20:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648159#M194100</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-05-15T20:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648160#M194101</link>
      <description>&lt;P&gt;Yeah. Mr Miller's approaches are indeed among the best. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 20:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648160#M194101</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T20:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648164#M194102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304931"&gt;@superbug&lt;/a&gt;&amp;nbsp; How I wish you posted your expected output for your input sample. So do you mean you want the min(int(&lt;SPAN&gt;SScore_se)&amp;nbsp; value to remerge with the original dataset?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 20:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648164#M194102</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T20:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648166#M194103</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;It seems I made a simple question become complex. In the table below, the first two columns are my input file. In the output file, I like the "want" column to be added. Values in "want" column is the smallest number (take integer) of the "SScore_se" column. I used the following code, but it does not work. please help. thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if SScore=200 then want=INT(MIN(SScore_se);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;SScore_se&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;SScore&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;want&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;165.1214&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;119.3441&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;88.05075&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 15 May 2020 21:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648166#M194103</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-05-15T21:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648167#M194104</link>
      <description>&lt;P&gt;Holy Jesus!, Right I hope I understood the requirement this time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
create table want as
select *,min(int(SScore_se)) as want
from have
group by SScore;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648167#M194104</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T21:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648171#M194106</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a bunch!&lt;/P&gt;
&lt;P&gt;I have some other condition when defining "want". As table below&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;SScore_se&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;SScore&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;want&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;165.1214&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;119.3441&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;88.05075&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl65" style="height: 15.0pt; border-top: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;86.90429&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;800&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;86&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;118.478&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;800&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;86&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;164.494&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;800&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;86&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could you please help incorporate the following condition to your code?&lt;/P&gt;
&lt;P&gt;if sscore=200 or sscore=800 then want=INT(MIN(sscore_se));&lt;/P&gt;
&lt;P&gt;if 200&amp;lt;sscore&amp;lt;800 then want=INT(sscore_se);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648171#M194106</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-05-15T21:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648174#M194109</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
 
data have;
input SScore_se	SScore;*	want;
cards;
165.1214	200	88
119.3441	200	88
88.05075	200	88
86.90429	800	86
118.478	    800	86
164.494	    800	86
87.90429	500	86
119.478	    500	86
165.494	    500	86
;
proc sql;
create table want(drop=grp) as
select *,case when sscore in (200,800) or 200&amp;lt;sscore&amp;lt;800 then sscore
else 0 end as grp,min(int(SScore_se)) as want
from have
group by grp;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 21:41:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648174#M194109</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-15T21:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648178#M194110</link>
      <description>&lt;P&gt;Replace the N/SUM in the PROC MEANS with MIN or MAX or whatever statistics you want. Look at the documentation for PROC MEANS to find all the statistics available.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648178#M194110</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-15T21:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648180#M194111</link>
      <description>It looks like overall you're trying to add summary group statistics to your main data set. There are two standard ways to do this and both are illustrated here with full examples. You'll need to change the statistics to the ones you want to calculate but both approaches are valid.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset.sas&lt;/A&gt;</description>
      <pubDate>Fri, 15 May 2020 21:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648180#M194111</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-15T21:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get min  value in this condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648187#M194113</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks! A big thumb to you!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 22:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-min-value-in-this-condition/m-p/648187#M194113</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2020-05-15T22:14:42Z</dc:date>
    </item>
  </channel>
</rss>

