<?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 Proc Freq or Proc Summary in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128140#M35028</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 have a datafile containing survey responses with demographics. Let's say, 10 questions (Q1-Q10) and 3 demographics ( Age, Gender and Experience). All questions are six-point scale questions. That means 6 choices in multiple choice questions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate count percentage of 5 and 6 for each questions by Age demographic. Age demog contains 5 options. I used Proc Freq statement but it doesn't allow me to break question frequency by Age. And i didn't find any option for count percentage in Proc MEANS or Proc SUMMARY.&lt;/P&gt;&lt;P&gt;Is it possible to accomplish this using Proc SUMMARY?? I don't want to use PROC SQL for this as i am learning SAS Base &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Jul 2013 11:02:12 GMT</pubDate>
    <dc:creator>Ujjawal</dc:creator>
    <dc:date>2013-07-07T11:02:12Z</dc:date>
    <item>
      <title>Proc Freq or Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128140#M35028</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 have a datafile containing survey responses with demographics. Let's say, 10 questions (Q1-Q10) and 3 demographics ( Age, Gender and Experience). All questions are six-point scale questions. That means 6 choices in multiple choice questions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate count percentage of 5 and 6 for each questions by Age demographic. Age demog contains 5 options. I used Proc Freq statement but it doesn't allow me to break question frequency by Age. And i didn't find any option for count percentage in Proc MEANS or Proc SUMMARY.&lt;/P&gt;&lt;P&gt;Is it possible to accomplish this using Proc SUMMARY?? I don't want to use PROC SQL for this as i am learning SAS Base &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jul 2013 11:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128140#M35028</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2013-07-07T11:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq or Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128141#M35029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;where is your sample data and the final output you need ?&lt;/P&gt;&lt;P&gt;Do you mind to use proc tabulate or proc report ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jul 2013 11:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128141#M35029</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-07-07T11:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq or Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128142#M35030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data have;
input age q1 q2;
cards;
12 1 2
12 6 5
12 5 6
12 2 6
22 6 2
22 2 5
22 5 6
22 5 6
;
run;
data temp(drop=i q:);
 set have;
 array x{*} q: ;
 do i=1 to dim(x);
&amp;nbsp; name=vname(x{i});value=x{i};output;
 end;
run;
proc sort data=temp;
 by age name value;
run;
proc freq noprint;
table age*name*value/list out=want(where=(value in (5 6))) nocum;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jul 2013 11:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128142#M35030</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-07-07T11:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq or Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128143#M35031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KSharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for writing the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is generating count percentage of 5 or 6 separately. I am looking for the combined percentage of 5 and 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 15:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128143#M35031</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2013-07-08T15:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq or Proc Summary</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128144#M35032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use proc format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
input age q1 q2;
cards;
12 1 2
12 6 5
12 5 6
12 2 6
22 6 2
22 2 5
22 5 6
22 5 6
;
run;
data temp(drop=i q:);
 set have;
 array x{*} q: ;
 do i=1 to dim(x);
&amp;nbsp; name=vname(x{i});value=x{i};output;
 end;
run;
proc sort data=temp;
 by age name value;
run;





proc format;
value fmt
&amp;nbsp; 5,6='5 and 6';
run;

proc freq noprint;
table age*name*value/list out=want(where=(value in (5 6))) nocum;
format value fmt.;
run;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 15:42:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-or-Proc-Summary/m-p/128144#M35032</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-07-08T15:42:51Z</dc:date>
    </item>
  </channel>
</rss>

