<?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 use proc freq to find results in multible variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858685#M339273</link>
    <description>&lt;P&gt;Hi, below is an example of the data I have (in reality about 20000 entries and many more variables).&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Identifier&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Var_1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Var_2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Var_3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FD&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FD&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FD&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I used proq freq to find frequencies of 'ZN', 'DS' and 'FD' for Var_1, Var_2 and Var_3 seperately like so:&lt;/P&gt;&lt;P&gt;proc freq data=rehab order=freq;&lt;BR /&gt;tables Var_1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find the freq. of 'ZN' and so on in all three variables, but not counting them multible times. As in "so many have 'ZN' at all and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant seem to grasp it - is it possible oh clever internet-people?&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2023 10:40:39 GMT</pubDate>
    <dc:creator>miajoe</dc:creator>
    <dc:date>2023-02-14T10:40:39Z</dc:date>
    <item>
      <title>How to use proc freq to find results in multible variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858685#M339273</link>
      <description>&lt;P&gt;Hi, below is an example of the data I have (in reality about 20000 entries and many more variables).&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Identifier&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Var_1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Var_2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Var_3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FD&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;DS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FD&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;FD&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ZN&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I used proq freq to find frequencies of 'ZN', 'DS' and 'FD' for Var_1, Var_2 and Var_3 seperately like so:&lt;/P&gt;&lt;P&gt;proc freq data=rehab order=freq;&lt;BR /&gt;tables Var_1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find the freq. of 'ZN' and so on in all three variables, but not counting them multible times. As in "so many have 'ZN' at all and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant seem to grasp it - is it possible oh clever internet-people?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 10:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858685#M339273</guid>
      <dc:creator>miajoe</dc:creator>
      <dc:date>2023-02-14T10:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use proc freq to find results in multible variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858691#M339278</link>
      <description>&lt;P&gt;Bad dataset structure leads to complicated code. See Maxim 19.&lt;/P&gt;
&lt;P&gt;Transpose first, get rid of the duplicates, FREQ:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=long (keep=identifier col1);
by identifier;
var var_:;
run;

proc sort data=long nodupkey;
by identifier col1;
run;

proc freq data=long;
tables col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Feb 2023 10:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858691#M339278</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-02-14T10:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use proc freq to find results in multible variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858696#M339279</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;The dataset has many more facets, and it is also relevant how many have 1, 2 or three and which have dublicates.&lt;/P&gt;&lt;P&gt;Transposing a copy of the dataset for anwering specific questions does however seem to be the answer, and your code did work for that so thank you very much!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 11:06:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858696#M339279</guid>
      <dc:creator>miajoe</dc:creator>
      <dc:date>2023-02-14T11:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use proc freq to find results in multible variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858726#M339290</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439508"&gt;@miajoe&lt;/a&gt;, glad to see that it worked. Did&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;solve your problem? If so, please mark this as solved and that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;provided the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will help others in the future that may run into the same issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 13:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-freq-to-find-results-in-multible-variables/m-p/858726#M339290</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2023-02-14T13:46:02Z</dc:date>
    </item>
  </channel>
</rss>

