<?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: Questionnaire type group in Proc Tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583653#M75736</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
input ID Emp$ Gen$ Q1$ Q2$ Q3$ Q4$ Q5$;
cards;
132 Govt M Y N N N N
321 Prvt F N Y Y N N
159 Prvt F Y Y N N N
357 Govt M N N N N Y
;
proc transpose data=aaa out=have(where=(col1='Y'));
by id emp gen notsorted;
var Q:;
run;
proc tabulate data = have;
class _name_ Emp Gen;
tables _name_=' ' all, Emp=' '*Gen=' '*(n colpctn='%')*f=8.0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 24 Aug 2019 11:46:38 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-08-24T11:46:38Z</dc:date>
    <item>
      <title>Questionnaire type group in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583644#M75735</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Questionnaire type dataset to evaluate the value of the boolean type (Y/N) questions.&lt;/P&gt;&lt;P&gt;I shared the sample dataset below for better understanding.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
input ID Emp$ Gen$ Q1$ Q2$ Q3$ Q4$ Q5$;
cards;
132 Govt M Y N N N N
321 Prvt F N Y Y N N
159 Prvt F Y Y N N N
357 Govt M N N N N Y
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have to calculate the N(sum) and % of how many Y (Yes) checked.&lt;/P&gt;&lt;P&gt;I expect the result as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab.jpg" style="width: 425px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32003iBC0209A58A857D64/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab.jpg" alt="tab.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I tried with Proc Tabulate but it returns partial output.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data = aaa;
class Q1 Q2 Q3 Q4 Q5 Emp Gen;
tables (Q1 Q2 Q3 Q4 Q5)* all, Emp*(Gen);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please suggest a solution to solve the given problem.&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2019 10:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583644#M75735</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-08-24T10:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Questionnaire type group in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583653#M75736</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
input ID Emp$ Gen$ Q1$ Q2$ Q3$ Q4$ Q5$;
cards;
132 Govt M Y N N N N
321 Prvt F N Y Y N N
159 Prvt F Y Y N N N
357 Govt M N N N N Y
;
proc transpose data=aaa out=have(where=(col1='Y'));
by id emp gen notsorted;
var Q:;
run;
proc tabulate data = have;
class _name_ Emp Gen;
tables _name_=' ' all, Emp=' '*Gen=' '*(n colpctn='%')*f=8.0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Aug 2019 11:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583653#M75736</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-08-24T11:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Questionnaire type group in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583654#M75737</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
input ID Emp$ Gen$ Q1$ Q2$ Q3$ Q4$ Q5$;
cards;
132 Govt M Y N N N N
321 Prvt F N Y Y N N
159 Prvt F Y Y N N N
357 Govt M N N N N Y
;
proc transpose data=aaa out=have(where=(col1='Y'));
by id emp gen notsorted;
var Q:;
run;

proc format ;
value $ fmt(notsorted)
 'M'='M'
 'F'='F';
run;
proc tabulate data = have;
class _name_ Emp Gen / preloadfmt order=data;
format gen $fmt.;
tables _name_=' ' all, Emp=' '*Gen=' '*(n colpctn='%')*f=8.0 /printmiss;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Aug 2019 11:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583654#M75737</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-08-24T11:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Questionnaire type group in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583810#M75742</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;. Both solutions fit my expected result.&lt;/P&gt;&lt;P&gt;Once again Thanks for your time and consideration.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 03:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Questionnaire-type-group-in-Proc-Tabulate/m-p/583810#M75742</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-08-26T03:36:57Z</dc:date>
    </item>
  </channel>
</rss>

