<?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: help with grouping multiple column in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119268#M32889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Arthur for your patience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it can be assigned to more than one test.&lt;/P&gt;&lt;P&gt;for eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for one of the IDs it can be:&lt;/P&gt;&lt;P&gt;MJ376 0 1 1&amp;nbsp; 0 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, in some cases all the values can be zero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2012 14:56:11 GMT</pubDate>
    <dc:creator>rak123</dc:creator>
    <dc:date>2012-11-07T14:56:11Z</dc:date>
    <item>
      <title>help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119262#M32883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having trouble when dealing with multiple column:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;column A B C D and each column have value of either 0 or 1. I want to make a new variable to be able to use the PROC FREQ function for the new variable so that I can know the frequency of each individual column. Any thoughts please ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 10:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119262#M32883</guid>
      <dc:creator>rak123</dc:creator>
      <dc:date>2012-11-07T10:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119263#M32884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you clarify exactly what you want please.&amp;nbsp; My reading of the question is that you want to create a new variable that sums across the values of variables A - D so that you can perform a proc freq on that new variable, is that correct? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 12:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119263#M32884</guid>
      <dc:creator>Keith</dc:creator>
      <dc:date>2012-11-07T12:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119264#M32885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I am looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AB348 0 0 0 0 1 0&lt;/P&gt;&lt;P&gt;SB876 0 1 0 0 0 0&lt;/P&gt;&lt;P&gt;VB912 0 0 1 0 0 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I want to name a new variable which consists of the last five variable in the above data set. Then, I want to do the PROC FREQ on the new variable so that I can get the individual freq of each of the five variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I am clear this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 13:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119264#M32885</guid>
      <dc:creator>rak123</dc:creator>
      <dc:date>2012-11-07T13:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119265#M32886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, I think you have to be clearer.&amp;nbsp; In addition to the fact that your example has 2 rows with 7 variables each, and one with 6, what do you want the resulting dataset to look like (please show as a datastep) and what do you want the result of proc freq to look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 13:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119265#M32886</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-07T13:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119266#M32887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I apologize for being not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the dataset:&lt;/P&gt;&lt;P&gt;ID $ TestA TestB TestC TestD TestE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;AB348 0 0 0 0 1 &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;SB876 0 1 0 0 0 &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VB912 0 0 1 0 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;SK623 1 0 0 0 0&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;and so on--------&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I want a new variable "Test" on which I should be able to perform the PROC FREQ:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;and the output should look like&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Frequency&amp;nbsp;&amp;nbsp; Percent Cumulative_Frequency Cumulative Percent&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-----------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;TestA&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;TestB&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;TestC&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;TestD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;TestE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hopefully, I am clear now.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks for helping me out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 14:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119266#M32887</guid>
      <dc:creator>rak123</dc:creator>
      <dc:date>2012-11-07T14:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119267#M32888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not quite clear enough.&amp;nbsp; Can a record be assigned to more than one test or are they mutually exclusive?&amp;nbsp; And, will there ever be a case where all of the tests have a value of 0?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 14:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119267#M32888</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-07T14:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119268#M32889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Arthur for your patience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it can be assigned to more than one test.&lt;/P&gt;&lt;P&gt;for eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for one of the IDs it can be:&lt;/P&gt;&lt;P&gt;MJ376 0 1 1&amp;nbsp; 0 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, in some cases all the values can be zero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 14:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119268#M32889</guid>
      <dc:creator>rak123</dc:creator>
      <dc:date>2012-11-07T14:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119269#M32890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does the following accomplish what you want/need?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID $ TestA TestB TestC TestD TestE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;AB348 0 0 1 0 1&lt;/P&gt;&lt;P&gt;SB876 0 1 1 0 0&lt;/P&gt;&lt;P&gt;VB912 0 0 0 0 0&lt;/P&gt;&lt;P&gt;SK623 1 0 0 1 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data need (keep=id test);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length test $5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array _test TestA--TestE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over _test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _test eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test=vname(_test);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=need;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table test;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 15:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119269#M32890</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-07T15:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119270#M32891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WOW...Thanks a lot, Arthur. That was really helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just have another quick question. How can I combine TestD and TestE and make a column name "Test_Var" and then I need to do the same thing with &lt;/P&gt;&lt;P&gt;the data variables as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; ID $ TestA TestB TestC Test_Var&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thank you very much.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 15:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119270#M32891</guid>
      <dc:creator>rak123</dc:creator>
      <dc:date>2012-11-07T15:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119271#M32892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way would be to just extend the same logic.&amp;nbsp; E.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID $ TestA TestB TestC TestD TestE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;AB348 0 0 1 0 1&lt;/P&gt;&lt;P&gt;SB876 0 1 1 0 0&lt;/P&gt;&lt;P&gt;VB912 0 0 0 0 0&lt;/P&gt;&lt;P&gt;SK623 1 0 0 1 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data need (keep=id test);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length test $8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array _test TestA--TestE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do over _test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _test eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if vname(_test) in ('TestD','TestE') then test='Test_Var';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else test=vname(_test);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=need;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table test;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 15:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119271#M32892</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-07T15:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: help with grouping multiple column</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119272#M32893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That certainly works. Thank you very much for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 15:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-grouping-multiple-column/m-p/119272#M32893</guid>
      <dc:creator>rak123</dc:creator>
      <dc:date>2012-11-07T15:43:38Z</dc:date>
    </item>
  </channel>
</rss>

