<?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 How to group variables and count based on groups in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492162#M31733</link>
    <description>&lt;P&gt;data Single;&lt;BR /&gt;input Single $10.;&lt;BR /&gt;cards;&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data Multiple;&lt;BR /&gt;input Multiple $10.;&lt;BR /&gt;cards;&lt;BR /&gt;D&lt;BR /&gt;e&lt;BR /&gt;f&lt;BR /&gt;g&lt;BR /&gt;h&lt;BR /&gt;i&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;I want input value in 'single' counted 1 account&lt;BR /&gt;output for single&lt;BR /&gt;Single Account&lt;BR /&gt;a 1&lt;BR /&gt;b 1&lt;BR /&gt;c 1&lt;/P&gt;&lt;P&gt;For multiple, because d&amp;amp;e is one account, f&amp;amp;g&amp;amp;h&amp;amp;i is one account&lt;BR /&gt;output i want for multiple is&lt;BR /&gt;Multiple Account&lt;BR /&gt;d&amp;amp;e 1&lt;BR /&gt;f&amp;amp;g&amp;amp;h&amp;amp;i 1&lt;/P&gt;&lt;P&gt;I dont mine putting them together in same data set, I just want to make sure the combination is correct for it to count the correct account numbers.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Sep 2018 03:21:30 GMT</pubDate>
    <dc:creator>miss2223</dc:creator>
    <dc:date>2018-09-04T03:21:30Z</dc:date>
    <item>
      <title>How to group variables and count based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492162#M31733</link>
      <description>&lt;P&gt;data Single;&lt;BR /&gt;input Single $10.;&lt;BR /&gt;cards;&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data Multiple;&lt;BR /&gt;input Multiple $10.;&lt;BR /&gt;cards;&lt;BR /&gt;D&lt;BR /&gt;e&lt;BR /&gt;f&lt;BR /&gt;g&lt;BR /&gt;h&lt;BR /&gt;i&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;I want input value in 'single' counted 1 account&lt;BR /&gt;output for single&lt;BR /&gt;Single Account&lt;BR /&gt;a 1&lt;BR /&gt;b 1&lt;BR /&gt;c 1&lt;/P&gt;&lt;P&gt;For multiple, because d&amp;amp;e is one account, f&amp;amp;g&amp;amp;h&amp;amp;i is one account&lt;BR /&gt;output i want for multiple is&lt;BR /&gt;Multiple Account&lt;BR /&gt;d&amp;amp;e 1&lt;BR /&gt;f&amp;amp;g&amp;amp;h&amp;amp;i 1&lt;/P&gt;&lt;P&gt;I dont mine putting them together in same data set, I just want to make sure the combination is correct for it to count the correct account numbers.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 03:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492162#M31733</guid>
      <dc:creator>miss2223</dc:creator>
      <dc:date>2018-09-04T03:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to group variables and count based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492210#M31736</link>
      <description>&lt;P&gt;How do we know that d&amp;amp;e are one account from your data? Please be more specific.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 07:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492210#M31736</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-09-04T07:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to group variables and count based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492336#M31745</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/229416"&gt;@miss2223&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;data Single;&lt;BR /&gt;input Single $10.;&lt;BR /&gt;cards;&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;data Multiple;&lt;BR /&gt;input Multiple $10.;&lt;BR /&gt;cards;&lt;BR /&gt;D&lt;BR /&gt;e&lt;BR /&gt;f&lt;BR /&gt;g&lt;BR /&gt;h&lt;BR /&gt;i&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;I want input value in 'single' counted 1 account&lt;BR /&gt;output for single&lt;BR /&gt;Single Account&lt;BR /&gt;a 1&lt;BR /&gt;b 1&lt;BR /&gt;c 1&lt;/P&gt;
&lt;P&gt;For multiple, because d&amp;amp;e is one account, f&amp;amp;g&amp;amp;h&amp;amp;i is one account&lt;BR /&gt;output i want for multiple is&lt;BR /&gt;Multiple Account&lt;BR /&gt;d&amp;amp;e 1&lt;BR /&gt;f&amp;amp;g&amp;amp;h&amp;amp;i 1&lt;/P&gt;
&lt;P&gt;I dont mine putting them together in same data set, I just want to make sure the combination is correct for it to count the correct account numbers.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please be careful with providing&amp;nbsp; "example" data and using different values. You example has capital D but you refer to d&amp;amp;e. The values would actually be different in terms of code in general.&lt;/P&gt;
&lt;P&gt;And I will emphasize &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s comment that there is nothing in the data shown that indicates D and e should be considered as one anything or that f, g, h and&amp;nbsp;I&amp;nbsp;(sorry the forum capitalizes single letter I ) are another group. There really needs to be some logic, rule or a reference data set.&lt;/P&gt;
&lt;P&gt;If there is no reference but your personal knowledge then you might consider a custom format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value $acct
'a'='a'
'b'='b'
'c'='c'
'd','e'='d &amp;amp; e'
'f','g','h','i' = 'f &amp;amp; g &amp;amp; h &amp;amp; i'
;
run;
data Single;
input Single $10.;
cards;
a
b
c
;
data Multiple;
input Multiple $10.;
cards;
d
e
f
g
h
i
;
run;

proc freq data=single;
   tables single;
   format single $acct.;
run;
proc freq data=multiple;
   table multiple;
   format multiple $acct.;
run;
&lt;/PRE&gt;
&lt;P&gt;Please not that I changed the value from "D" to "d" to match your output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Formats are case and spelling sensitive for display values, so attention to detail when creating them is important. If you actually have different spellings that should be treated the same they would all go on the same definition line as in the "multiple" values in the example format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note pasting example code into a code box opened using the forum's {I} icon. Code box entered (or pasted)&amp;nbsp;code is less likely to be reformatted by the forum and is easier to copy and paste into an editor to run.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 15:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492336#M31745</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-04T15:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to group variables and count based on groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492532#M31749</link>
      <description>&lt;P&gt;Seems like I didnt make it clear on my question.&lt;/P&gt;&lt;P&gt;Lets say&lt;/P&gt;&lt;P&gt;/* Independent item&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data Single;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input Single $10.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Toyota&lt;BR /&gt;Cloud&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Substitution item&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data Multiple;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input Multiple $10.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cards;&lt;/SPAN&gt;&lt;BR /&gt;Berry&lt;BR /&gt;Pen&lt;BR /&gt;Paper&lt;BR /&gt;English&lt;/P&gt;&lt;P&gt;Orange&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Spanish&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OUTPUT to appear&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Single&amp;nbsp;Output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Toyota 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cloud 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* As Berry and Orange they both belongs to the group of Fruits, I want the output to appear as 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* Pen and paper is a group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* English and Spanish is in a group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Multiple Outout&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Berry &amp;amp;&amp;nbsp;Orange 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pen &amp;amp; Paper 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;English &amp;amp; Spanish 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it makes it clear. Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 02:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-group-variables-and-count-based-on-groups/m-p/492532#M31749</guid>
      <dc:creator>miss2223</dc:creator>
      <dc:date>2018-09-05T02:57:05Z</dc:date>
    </item>
  </channel>
</rss>

