<?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: Select data in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366235#M5458</link>
    <description>&lt;P&gt;alternatively try the proc means&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have nway;
class sex;
var runtime;
output out=want max=max;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Jun 2017 17:19:03 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2017-06-12T17:19:03Z</dc:date>
    <item>
      <title>Select data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366224#M5456</link>
      <description>&lt;P&gt;Hi guys, I am required to produce output like the image sample from the fitness data set. May I know the solutions? The questions is like: What is the highest runtime for male and female individuals in the fitness data file?&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9330i22F5E0D9FA981AC1/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="123.png" title="123.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9329iDA7D7A5B5B6C545C/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Untitled.png" title="Untitled.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 16:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366224#M5456</guid>
      <dc:creator>pailek1996</dc:creator>
      <dc:date>2017-06-12T16:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366230#M5457</link>
      <description>&lt;P&gt;something like this&lt;/P&gt;
&lt;PRE&gt; title  'max runtime for female';
 proc sql;
 select max(runtime) as mxdata from sashelp.class
 where sex= 'F';
title;
 title  'max runtime for Male'; 
select max(runtime) as mxdata from sashelp.class
 where sex= 'M';
 quit;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366230#M5457</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-06-12T17:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366235#M5458</link>
      <description>&lt;P&gt;alternatively try the proc means&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have nway;
class sex;
var runtime;
output out=want max=max;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366235#M5458</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-06-12T17:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366247#M5459</link>
      <description>&lt;P&gt;May i know, how can i get the "Obs" as the image shown.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366247#M5459</guid>
      <dc:creator>pailek1996</dc:creator>
      <dc:date>2017-06-12T17:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366257#M5460</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;number&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; max(runtime) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mxdata &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sex= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'F'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'max runtime for Male'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; max(runtime) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mxdata &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sex= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'M'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;but this shows up as ROW instead of obs as heading or use SAS undocumented function monotonic() as shown below&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; monotonic() &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Obs, max(runtime) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mxdata &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sex= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'F'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'max runtime for Male'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; monotonic() &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Obs, max(runtime) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mxdata &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sex= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'M'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366257#M5460</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-06-12T17:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366261#M5461</link>
      <description>Thanks so much! This the solution I am looking for, much appreciated!</description>
      <pubDate>Mon, 12 Jun 2017 17:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Select-data/m-p/366261#M5461</guid>
      <dc:creator>pailek1996</dc:creator>
      <dc:date>2017-06-12T17:59:03Z</dc:date>
    </item>
  </channel>
</rss>

