<?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: proc sql ptoc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472362#M121121</link>
    <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select country, productid, max(quantity) as maxqty
from new
group by country
having quantity = max(quantity);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Jun 2018 03:31:19 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-06-22T03:31:19Z</dc:date>
    <item>
      <title>proc sql ptoc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472233#M121048</link>
      <description>i need to know.. how to solve this querry&lt;BR /&gt;countrywise breakup of&lt;BR /&gt;most purchased product&lt;BR /&gt;least purchased product&lt;BR /&gt;since i am fresher in sas kindly help..</description>
      <pubDate>Thu, 21 Jun 2018 18:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472233#M121048</guid>
      <dc:creator>sourabhy</dc:creator>
      <dc:date>2018-06-21T18:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql ptoc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472249#M121061</link>
      <description>&lt;P&gt;Please post the code you already tried, and some example data for testing.&lt;/P&gt;
&lt;P&gt;Post data in a data step with &lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0114gachtut3nn1and4ap8ke9nf.htm" target="_self"&gt;datalines&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472249#M121061</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-21T18:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql ptoc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472276#M121075</link>
      <description>&lt;P&gt;"Most purchased product" would require a definition. It could represent 1) frequency of purchase, 2) total currency value of purchases, 3) largest numbers of unique purchasers and likely a few more ideas depending on what the "product" concerns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as a minimum a description of your data would help provide more targeted suggestions, best is some example data in the form of a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, do you want/need a data step to provide input to a model or further data processing or do you want a report that people will read?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would likely look at starting with Proc summary with your country and product variables as CLASS variables and what ever you are using to measure "most" or "least" as VAR variable that gets summed. I would likely use the NWAY option as well unless I wanted sums of the VAR variables overall, by country regardless of product and by product regardless of country.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 19:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472276#M121075</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-21T19:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql ptoc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472353#M121117</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; new;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; productid $ country $ quantity &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;22139 UK 56&lt;/P&gt;&lt;P&gt;21773 UK 4&lt;/P&gt;&lt;P&gt;21773 UK 5&lt;/P&gt;&lt;P&gt;21801 UK 34&lt;/P&gt;&lt;P&gt;21056 SA 1&lt;/P&gt;&lt;P&gt;21773 SA 34&lt;/P&gt;&lt;P&gt;34788 MN 345&lt;/P&gt;&lt;P&gt;3456 MN 234&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need table given below:&lt;/P&gt;&lt;P&gt;title "most purchased product"&lt;/P&gt;&lt;P&gt;country&amp;nbsp;&amp;nbsp; productid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxqty(as per quantity)&lt;/P&gt;&lt;P&gt;UK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22139&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/P&gt;&lt;P&gt;SA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21773&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34&lt;/P&gt;&lt;P&gt;MN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;34788&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 345&lt;/P&gt;&lt;P&gt;similarly for least purchased product&lt;/P&gt;&lt;P&gt;didn't got the same output.&lt;/P&gt;&lt;P&gt;kindly help&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 02:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472353#M121117</guid>
      <dc:creator>sourabhy</dc:creator>
      <dc:date>2018-06-22T02:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql ptoc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472362#M121121</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select country, productid, max(quantity) as maxqty
from new
group by country
having quantity = max(quantity);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 03:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-ptoc-report/m-p/472362#M121121</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-22T03:31:19Z</dc:date>
    </item>
  </channel>
</rss>

