<?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: Proc Freq. Create table for all variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164051#M300291</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc tabulate will do that to that to a destination, but not sure what the output tables look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Aug 2014 02:51:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-08-16T02:51:36Z</dc:date>
    <item>
      <title>Proc Freq. Create table for all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164050#M300290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to run proc freq to create a table with each column reporting frequency of each variable in the original dataset.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My original data variables only take value 1, 2 ,3. So it will be quite convenient to get that summary table since it only have 3 row (1,2,3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess there should be a way to do it rather than getting table one by one and combine them with proc sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output should be in the format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1&amp;nbsp;&amp;nbsp;&amp;nbsp; var2&amp;nbsp;&amp;nbsp;&amp;nbsp; var3&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HHC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input var1 var2 var3&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 1 1&lt;/P&gt;&lt;P&gt;2 1 2&lt;/P&gt;&lt;P&gt;3 1 2&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 02:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164050#M300290</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2014-08-16T02:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq. Create table for all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164051#M300291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc tabulate will do that to that to a destination, but not sure what the output tables look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 02:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164051#M300291</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-08-16T02:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq. Create table for all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164052#M300292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you want the output to look like? summary for values Var1,2,3 stacked vertically? horizontally? row headings of 1,2,3 with a column count for each of your variables?&lt;/P&gt;&lt;P&gt;Lots of ways to combine frequency counts but what you want for a final product will affect the approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 16:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164052#M300292</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-18T16:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq. Create table for all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164053#M300293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might take a little reshaping of your data, but it's not lengthy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data reshape;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array vars {5} var1-var5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do _i_=1 to 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; varname = vname(vars{_i_});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = vars{_i_};&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; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; keep varname value;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=reshape;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; class varname value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables value, varname * N=' ' * f=12.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I might prefer one variable per row instead of one per column, such as (all else remaining the same):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables varname, N * value=' ' * f=12.&amp;nbsp;&amp;nbsp; PCTN &amp;lt;value&amp;gt; * value=' ' ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 17:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Freq-Create-table-for-all-variables/m-p/164053#M300293</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-08-18T17:27:45Z</dc:date>
    </item>
  </channel>
</rss>

