<?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 tabulate: Print column with no observation in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-Print-column-with-no-observation/m-p/856046#M37757</link>
    <description>&lt;P&gt;I think a pre-Loaded format is one way.&amp;nbsp; With an extra option or two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat Week mmddyy8.;
input ID Group $ Week  Disease $ Result $   ;
Format week date7.;
cards;
01 A 12/03/22 X Pos 
02 A 12/03/22 Y Pos 
03 B 12/17/22 Z Neg
04 A 12/17/22 X Pos 
05 B 12/24/22 Y Pos
06 B 12/24/22 Z Neg
07 C 12/24/22 X Neg 
08 A 12/31/22 Y Pos
09 A 01/14/23 Z Neg
10 B 01/14/23 X Pos 
11 A 01/21/23 Y Pos
12 A 01/21/23 Z Neg
13 A 01/14/23 Z Neg
14 C 01/14/23 X Neg 
15 A 01/21/23 Y Pos
16 C 01/21/23 Z Neg
17 A 01/14/23 Z Neg
18 C 01/14/23 Y Neg 
19 B 01/21/23 Y Pos
20 C 01/21/23 Z Neg
;
proc format; value $result(notsorted) 'Neg'='Neg' 'Pos'='Pos'; quit;
PROC TABULATE data=have missing;
   CLASS Disease;
   class Result / preloadfmt order=data;
   format result $Result.;
   TABLE Disease all="Total",  Result * N='' / printmiss misstext='0';
   Where group = "C" ;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 20:26:52 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2023-01-27T20:26:52Z</dc:date>
    <item>
      <title>Proc tabulate: Print column with no observation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-Print-column-with-no-observation/m-p/856044#M37756</link>
      <description>&lt;P&gt;I have the following data set.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat Week mmddyy8.;
input ID Group $ Week  Disease $ Result $   ;
Format week date7.;
cards;
01 A 12/03/22 X Pos 
02 A 12/03/22 Y Pos 
03 B 12/17/22 Z Neg
04 A 12/17/22 X Pos 
05 B 12/24/22 Y Pos
06 B 12/24/22 Z Neg
07 C 12/24/22 X Neg 
08 A 12/31/22 Y Pos
09 A 01/14/23 Z Neg
10 B 01/14/23 X Pos 
11 A 01/21/23 Y Pos
12 A 01/21/23 Z Neg
13 A 01/14/23 Z Neg
14 C 01/14/23 X Neg 
15 A 01/21/23 Y Pos
16 C 01/21/23 Z Neg
17 A 01/14/23 Z Neg
18 C 01/14/23 Y Neg 
19 B 01/21/23 Y Pos
20 C 01/21/23 Z Neg
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I ran the code below to create a table.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE data=have missing ;
CLASS Disease Result ;
TABLE Disease all="Total",  Result * N='' ;
Where group = "C" ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not see the&amp;nbsp; "Pos"&amp;nbsp;column in the output table since there is no "Pos" in the "result" column where group="C". However, I would like to keep the "Pos" column in the output with zero value.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 20:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-Print-column-with-no-observation/m-p/856044#M37756</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2023-01-27T20:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate: Print column with no observation</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-Print-column-with-no-observation/m-p/856046#M37757</link>
      <description>&lt;P&gt;I think a pre-Loaded format is one way.&amp;nbsp; With an extra option or two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat Week mmddyy8.;
input ID Group $ Week  Disease $ Result $   ;
Format week date7.;
cards;
01 A 12/03/22 X Pos 
02 A 12/03/22 Y Pos 
03 B 12/17/22 Z Neg
04 A 12/17/22 X Pos 
05 B 12/24/22 Y Pos
06 B 12/24/22 Z Neg
07 C 12/24/22 X Neg 
08 A 12/31/22 Y Pos
09 A 01/14/23 Z Neg
10 B 01/14/23 X Pos 
11 A 01/21/23 Y Pos
12 A 01/21/23 Z Neg
13 A 01/14/23 Z Neg
14 C 01/14/23 X Neg 
15 A 01/21/23 Y Pos
16 C 01/21/23 Z Neg
17 A 01/14/23 Z Neg
18 C 01/14/23 Y Neg 
19 B 01/21/23 Y Pos
20 C 01/21/23 Z Neg
;
proc format; value $result(notsorted) 'Neg'='Neg' 'Pos'='Pos'; quit;
PROC TABULATE data=have missing;
   CLASS Disease;
   class Result / preloadfmt order=data;
   format result $Result.;
   TABLE Disease all="Total",  Result * N='' / printmiss misstext='0';
   Where group = "C" ;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 20:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-Print-column-with-no-observation/m-p/856046#M37757</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2023-01-27T20:26:52Z</dc:date>
    </item>
  </channel>
</rss>

