<?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 proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql/m-p/282216#M57329</link>
    <description>hi, what should be the code for this question ? In the Grocery_coupons categorize the respondents i) into 3 categories based on their spending (below 100, 100-200 and above 200) ii) count the number of unique customers in each group ( using Select case when )? using proc sql</description>
    <pubDate>Tue, 05 Jul 2016 17:16:16 GMT</pubDate>
    <dc:creator>Prateek1</dc:creator>
    <dc:date>2016-07-05T17:16:16Z</dc:date>
    <item>
      <title>proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql/m-p/282216#M57329</link>
      <description>hi, what should be the code for this question ? In the Grocery_coupons categorize the respondents i) into 3 categories based on their spending (below 100, 100-200 and above 200) ii) count the number of unique customers in each group ( using Select case when )? using proc sql</description>
      <pubDate>Tue, 05 Jul 2016 17:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql/m-p/282216#M57329</guid>
      <dc:creator>Prateek1</dc:creator>
      <dc:date>2016-07-05T17:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql/m-p/282339#M57380</link>
      <description>&lt;P&gt;I am not sure if you are looking answer in one sql. &amp;nbsp;Below I have done in two steps and used case when for step 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table Grocery_coupons_category&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;/P&gt;&lt;P&gt;select Customer_id&lt;/P&gt;&lt;P&gt;,case when spending &amp;lt; 100 then 'Below 100'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;when spending between 100 and 200 then '100 - 200'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else 'Above 200'&amp;nbsp;&lt;/P&gt;&lt;P&gt;end as Customer_category&lt;/P&gt;&lt;P&gt;from Grocery_coupons;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create table Customer_count_category_wise&amp;nbsp;&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt;select &lt;SPAN&gt;Customer_category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;, count(distinct customer_id)&lt;/P&gt;&lt;P&gt;from&amp;nbsp;&lt;SPAN&gt;Grocery_coupons_category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;group by&amp;nbsp;&lt;SPAN&gt;Customer_category;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 03:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql/m-p/282339#M57380</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-07-06T03:18:40Z</dc:date>
    </item>
  </channel>
</rss>

