<?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: Counting two variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874588#M345565</link>
    <description>This works. Thank you!</description>
    <pubDate>Tue, 09 May 2023 00:29:02 GMT</pubDate>
    <dc:creator>Cuneyt</dc:creator>
    <dc:date>2023-05-09T00:29:02Z</dc:date>
    <item>
      <title>Counting two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874585#M345562</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set sorted by two variables (chain and store) and I would like to count them as shown below. Any help will be greatly appreciated.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;Chain&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;Store&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;x&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;x&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;y&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;z&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;z&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;z&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;w&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;w&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;w&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;q&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl64" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;q&lt;/TD&gt;
&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 08 May 2023 23:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874585#M345562</guid>
      <dc:creator>Cuneyt</dc:creator>
      <dc:date>2023-05-08T23:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Counting two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874587#M345564</link>
      <description>&lt;P&gt;Assuming the sorted order is correct:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   by chain store;
   if first.chain then count=1;
   else if first.store then count + 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 May 2023 23:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874587#M345564</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-05-08T23:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Counting two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874588#M345565</link>
      <description>This works. Thank you!</description>
      <pubDate>Tue, 09 May 2023 00:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Counting-two-variables/m-p/874588#M345565</guid>
      <dc:creator>Cuneyt</dc:creator>
      <dc:date>2023-05-09T00:29:02Z</dc:date>
    </item>
  </channel>
</rss>

