<?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 create summary statistics for each value of a variable using proc sql? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-summary-statistics-for-each-value-of-a-variable/m-p/766542#M242941</link>
    <description>&lt;P&gt;This is a job for PROC SUMMARY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
    class merchant_category;
    var amount num_transactions num_overseas_transactions;
    output out=_stats_ sum=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Sep 2021 10:45:04 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-09-08T10:45:04Z</dc:date>
    <item>
      <title>How to create summary statistics for each value of a variable using proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-summary-statistics-for-each-value-of-a-variable/m-p/766541#M242940</link>
      <description>&lt;P&gt;I have a transaction dataset with customer number, merchant category, transaction amount, online flag, and domestic/overseas flag.&lt;/P&gt;
&lt;P&gt;Merchant category has different observations like Dining, Apparel, Games, Grocery, electronics etc.&lt;/P&gt;
&lt;P&gt;Now for each of these merchant categories, I want to get the total amount spent, total number of online transactions, and total number of overseas transaction for each customer. Ex:&amp;nbsp; For Dining, there will be 3 variables: Total amount spent on dining, total number of online transactions for dining, and total numbe rof overseas dining transactions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for 5 different merchant categories, there will be 3 variable each, so total 15 variables in the final dataset, at a customer level.&lt;/P&gt;
&lt;P&gt;How do I do this rather than having to write 15 'Case When' statements in proc sql?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 10:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-summary-statistics-for-each-value-of-a-variable/m-p/766541#M242940</guid>
      <dc:creator>Shradha1</dc:creator>
      <dc:date>2021-09-08T10:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create summary statistics for each value of a variable using proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-summary-statistics-for-each-value-of-a-variable/m-p/766542#M242941</link>
      <description>&lt;P&gt;This is a job for PROC SUMMARY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
    class merchant_category;
    var amount num_transactions num_overseas_transactions;
    output out=_stats_ sum=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Sep 2021 10:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-summary-statistics-for-each-value-of-a-variable/m-p/766542#M242941</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-08T10:45:04Z</dc:date>
    </item>
  </channel>
</rss>

