<?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: MIN Value - Singular Column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780833#M248835</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would use an array on the transposed dataset (your values in the columns and not in the rows).&lt;/P&gt;
&lt;P&gt;You can indeed use the min function on an array of elements.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;With your values in the rows (and in one column) I would proceed as indicated by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;If you absolutely want to use the min data step function, you can do this;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
input value1;
datalines;
100
200
300
250
50
400
;
run;

data _NULL_;
 set work.test end=last;
 file print;
 retain minv;
 if _N_=1 then minv=value1;
 minv=min(minv,value1);
 if last then put minv;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 19:08:24 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2021-11-17T19:08:24Z</dc:date>
    <item>
      <title>MIN Value - Singular Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780810#M248819</link>
      <description>&lt;P&gt;I want to create a variable that is the minimum value of a variable in my dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I create a variable that refers to the MIN value of a single column? How would a get a variable say "min1" to report back the 50? I assume it has to do with arrays but I can't quite put my finger on it and every time I try just the "MIN" function I get an error of not enough arguments.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
input value1;
datalines;
100
200
300
250
50
400
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 18:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780810#M248819</guid>
      <dc:creator>eer_seer</dc:creator>
      <dc:date>2021-11-17T18:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: MIN Value - Singular Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780815#M248821</link>
      <description>&lt;P&gt;You need to process the whole dataset to get the minimum over all of the observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=test ;
  var value1;
  output out=want min=min1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Nov 2021 18:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780815#M248821</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-17T18:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: MIN Value - Singular Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780833#M248835</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would use an array on the transposed dataset (your values in the columns and not in the rows).&lt;/P&gt;
&lt;P&gt;You can indeed use the min function on an array of elements.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;With your values in the rows (and in one column) I would proceed as indicated by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;If you absolutely want to use the min data step function, you can do this;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
input value1;
datalines;
100
200
300
250
50
400
;
run;

data _NULL_;
 set work.test end=last;
 file print;
 retain minv;
 if _N_=1 then minv=value1;
 minv=min(minv,value1);
 if last then put minv;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 19:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780833#M248835</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-17T19:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: MIN Value - Singular Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780837#M248839</link>
      <description>&lt;P&gt;To be complete, I will add this extra possibility:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=work.test out=work.test_trp;
 var value1;
run;

data _NULL_;
 set work.test_trp;
 file print;
 min_value=min(of _NUMERIC_);
 put min_value=;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 19:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780837#M248839</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-17T19:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: MIN Value - Singular Column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780866#M248855</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select min(value1) from test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Nov 2021 20:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MIN-Value-Singular-Column/m-p/780866#M248855</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-17T20:28:37Z</dc:date>
    </item>
  </channel>
</rss>

