<?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 report tabulate result for cross table? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/640168#M23931</link>
    <description>&lt;P&gt;Hi, All&lt;/P&gt;&lt;P&gt;I want to create a cross table to summaries favorite before and after test the tasty and put stage 1 and stage 2 together. I have created codes to create the result, but could not report it as follow in rtf file, I am wondering if anyone can help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rtf ouput I want as follow:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="擷取.PNG" style="width: 736px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38340i346C2C0898F08787/image-size/large?v=v2&amp;amp;px=999" role="button" title="擷取.PNG" alt="擷取.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code as following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw;
input (Subject Stage Before After) ($);
cards;
1 I Like Like
2 II Abit Like
3 I Like Abit
4 II Abit Like
5 I Like Abit
6 II Like Like
7 II Abit Like
8 I Like Dislike
9 II Like Abit
10 I Dislike Like
11 II Abit Dislike
12 I Like ND
;
run;
&lt;BR /&gt;proc sort data=raw;
by Stage;
run;

data class;
format Before $8. After $8.;
do Before='Like', 'Abit', 'Dislike', 'ND';
do After='Like', 'Abit', 'Dislike', 'ND';
output;
end;
end;
run;

proc format;
value $FBefore
'Like'='Like'
'Abit'='A bit like'
'Dislike'='Dislike'
'ND'='Not Done';

value $FAfter
'Like'='Like'
'Abit'='A bit like'
'Dislike'='Dislike'
'ND'='Not Done';
run;

proc tabulate data=raw missing classdata=class;
format Before $FBefore. After $FAfter.;
class Before After/order=data;
table After, Before*(N=' ')/misstext='0';
by Stage;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Apr 2020 18:10:49 GMT</pubDate>
    <dc:creator>Charlie</dc:creator>
    <dc:date>2020-04-15T18:10:49Z</dc:date>
    <item>
      <title>How to report tabulate result for cross table?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/640168#M23931</link>
      <description>&lt;P&gt;Hi, All&lt;/P&gt;&lt;P&gt;I want to create a cross table to summaries favorite before and after test the tasty and put stage 1 and stage 2 together. I have created codes to create the result, but could not report it as follow in rtf file, I am wondering if anyone can help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rtf ouput I want as follow:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="擷取.PNG" style="width: 736px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38340i346C2C0898F08787/image-size/large?v=v2&amp;amp;px=999" role="button" title="擷取.PNG" alt="擷取.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code as following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw;
input (Subject Stage Before After) ($);
cards;
1 I Like Like
2 II Abit Like
3 I Like Abit
4 II Abit Like
5 I Like Abit
6 II Like Like
7 II Abit Like
8 I Like Dislike
9 II Like Abit
10 I Dislike Like
11 II Abit Dislike
12 I Like ND
;
run;
&lt;BR /&gt;proc sort data=raw;
by Stage;
run;

data class;
format Before $8. After $8.;
do Before='Like', 'Abit', 'Dislike', 'ND';
do After='Like', 'Abit', 'Dislike', 'ND';
output;
end;
end;
run;

proc format;
value $FBefore
'Like'='Like'
'Abit'='A bit like'
'Dislike'='Dislike'
'ND'='Not Done';

value $FAfter
'Like'='Like'
'Abit'='A bit like'
'Dislike'='Dislike'
'ND'='Not Done';
run;

proc tabulate data=raw missing classdata=class;
format Before $FBefore. After $FAfter.;
class Before After/order=data;
table After, Before*(N=' ')/misstext='0';
by Stage;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 18:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/640168#M23931</guid>
      <dc:creator>Charlie</dc:creator>
      <dc:date>2020-04-15T18:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to report tabulate result for cross table?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/640193#M23932</link>
      <description>&lt;P&gt;I think that instead of BY stage that you want Stage as a class variable in the column expression area. That would require modifying your classdata set to include stage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or use the PRELOADFMT option instead of class data.&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=raw missing ;
format Before $FBefore. After $FAfter.;
class Before After/order=data preloadfmt;
format before $fbefore.;
class stage;
table After, stage* Before*(N=' ')/misstext='0'
        printmiss;
;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2020 18:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/640193#M23932</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-15T18:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to report tabulate result for cross table?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/642494#M23978</link>
      <description>Thank you for your advice and code.&lt;BR /&gt;However, I still want to "Before" and "After" show the result order as the example, therefore, I have modified my code as following:&lt;BR /&gt;data class;&lt;BR /&gt;format Stage $8. Before $8. After $8.;&lt;BR /&gt;do Stage='I', 'II';&lt;BR /&gt;do Before='Like', 'Abit', 'Dislike', 'ND';&lt;BR /&gt;do After='Like', 'Abit', 'Dislike', 'ND';&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;value $FStage&lt;BR /&gt;'R'='I'&lt;BR /&gt;'T'='II';&lt;BR /&gt;&lt;BR /&gt;value $FBefore&lt;BR /&gt;'Like'='Like'&lt;BR /&gt;'Abit'='A bit like'&lt;BR /&gt;'Dislike'='Dislike'&lt;BR /&gt;'ND'='Not Done';&lt;BR /&gt;&lt;BR /&gt;value $FAfter&lt;BR /&gt;'Like'='Like'&lt;BR /&gt;'Abit'='A bit like'&lt;BR /&gt;'Dislike'='Dislike'&lt;BR /&gt;'ND'='Not Done';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc tabulate data=raw missing classdata=class;&lt;BR /&gt;format Stage $FStage. Before $FBefore. After $FAfter.;&lt;BR /&gt;class Stage Before After/order=data;&lt;BR /&gt;classlev Stage Before After;&lt;BR /&gt;format Before $FBefore.;&lt;BR /&gt;table After, Stage* Before*(N=' ')/misstext='0' printmiss;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 24 Apr 2020 09:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-report-tabulate-result-for-cross-table/m-p/642494#M23978</guid>
      <dc:creator>Charlie</dc:creator>
      <dc:date>2020-04-24T09:28:39Z</dc:date>
    </item>
  </channel>
</rss>

