<?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 Report - two across variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510103#M72974</link>
    <description>&lt;P&gt;thanks for the suggestions - continued hunting around, and finally found a solution:&lt;/P&gt;
&lt;P&gt;add MISSING&amp;nbsp;in the Proc Report line, and NOZERO in the across lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input grade type1 $ count1 type2a $ type2b $ count2;
cards;
1 A1 1 . . .
1 B1 1 . . .
1 C1 1 . . .
1 . . A2 A2a 1
1 . . A2 A2b 1
;
run;

proc report data=a &lt;STRONG&gt;missing&lt;/STRONG&gt;;
columns ("Grade" grade)  (type1,(count1))  (type2a, type2b,(count2));
define grade/' ' group;
define type1/' ' &lt;STRONG&gt;nozero&lt;/STRONG&gt; across;
define count1/' ' sum;
define type2a/' ' &lt;STRONG&gt;nozero&lt;/STRONG&gt;  across;
define type2b/' '&lt;STRONG&gt; nozero&lt;/STRONG&gt; across;
define count2/' ' sum;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 03 Nov 2018 00:26:39 GMT</pubDate>
    <dc:creator>Dave25</dc:creator>
    <dc:date>2018-11-03T00:26:39Z</dc:date>
    <item>
      <title>Proc Report - two across variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510063#M72966</link>
      <description>&lt;P&gt;I've got summary data, trying to create a report with Proc Report, with two Across variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i've included&amp;nbsp;some&amp;nbsp;stipped down&amp;nbsp;sample data - i can create two reports separately, but can't figure out how to put them together.&lt;/P&gt;
&lt;P&gt;any suggestions would be greatly appreaciated!&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input grade type1 $ count1 type2a $ type2b $ count2;&lt;BR /&gt;cards;&lt;BR /&gt;1 A1 1 . . .&lt;BR /&gt;1 B1 1 . . .&lt;BR /&gt;1 C1 1 . . .&lt;BR /&gt;1 . . A2 A2a 1&lt;BR /&gt;1 . . A2 A2b 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 'type1 - works fine';&lt;BR /&gt;proc report data=a;&lt;BR /&gt;columns ("Grade" grade) type1,(count1);&lt;BR /&gt;define grade/' ' group;&lt;BR /&gt;define type1/' ' across;&lt;BR /&gt;define count1/' ' sum;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 'type2a/type2b - works fine';&lt;BR /&gt;proc report data=a;&lt;BR /&gt;columns ("Grade" grade) type2a, type2b,(count2);&lt;BR /&gt;define grade/' ' group;&lt;BR /&gt;define type2a/' ' across;&lt;BR /&gt;define type2b/' ' across;&lt;BR /&gt;define count2/' ' sum;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 "Doesn't Work";&lt;BR /&gt;proc report data=a;&lt;BR /&gt;columns ("Grade" grade)&amp;nbsp; (type1,(count1))&amp;nbsp; (type2a, type2b,(count2));&lt;BR /&gt;define grade/' ' group;&lt;BR /&gt;define type1/' ' across;&lt;BR /&gt;define count1/' ' sum;&lt;BR /&gt;define type2a/' ' across;&lt;BR /&gt;define type2b/' ' across;&lt;BR /&gt;define count2/' ' sum;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 20:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510063#M72966</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2018-11-02T20:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - two across variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510070#M72967</link>
      <description>&lt;P&gt;Can you show what you would like the final single report table to look like? As it is we don't really know what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 21:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510070#M72967</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-02T21:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - two across variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510083#M72968</link>
      <description>&lt;P&gt;Apologies - i was hoping to get this result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD width="54"&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="3" width="88"&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="2" width="92"&gt;
&lt;P&gt;&lt;STRONG&gt;A2&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="54"&gt;
&lt;P&gt;&lt;STRONG&gt;Grade&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="30"&gt;
&lt;P&gt;&lt;STRONG&gt;A1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="29"&gt;
&lt;P&gt;&lt;STRONG&gt;B1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="30"&gt;
&lt;P&gt;&lt;STRONG&gt;C1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="44"&gt;
&lt;P&gt;&lt;STRONG&gt;A2a&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="48"&gt;
&lt;P&gt;&lt;STRONG&gt;A2b&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="54"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="30"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="29"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="30"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="44"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="48"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 02 Nov 2018 21:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510083#M72968</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2018-11-02T21:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - two across variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510089#M72972</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Provide input data in the form of data step code pasted into a code box"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input grade type1 $ count1 type2a $ type2b $ count2;
cards;
1 A1 1 . . .
1 B1 1 . . .
1 C1 1 . . .
1 . . A2 A2a 1
1 . . A2 A2b 1
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the log from the 3rd Proc Report (the one that doesn't work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;82   title1 "Doesn't Work";
83   proc report data=a;
84   columns ("Grade" grade)  (type1,(count1))  (type2a, type2b,(count2));
85   define grade/' ' group;
86   define type1/' ' across;
87   define count1/' ' sum;
88   define type2a/' ' across;
89   define type2b/' ' across;
90   define count2/' ' sum;
91   run;

WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation.
NOTE: There were 5 observations read from the data set WORK.A.
NOTE: PROCEDURE REPORT used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 21:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510089#M72972</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2018-11-02T21:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - two across variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510096#M72973</link>
      <description>&lt;P&gt;This almost works:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=a;
   class grade type1 type2a type2b /missing;
   var count1 count2;
   table grade,
         type1=''*count1=''*sum=''*f=best5.
         type2a=''*type2b=''*count2=''*sum=''*f=best5.
        /misstext=' ' row=float
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Proc tabulate is creating some extra columns because we have to allow missing values for the categories. The ='' are to suppress variable name or label from appearing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Often the WARNING about missing group, order or across variables (in Report) or class variables (in Proc tabulate) is an indication of possibly poor data structure&lt;/P&gt;
&lt;P&gt;Consider&lt;/P&gt;
&lt;PRE&gt;data example;
   input grade group $ subgroup $ count;
datalines;
1  1 A 13
1  1 B 4
1  1 C 12
1  2 Aa 14
1  2 Ab  9
;
run;

proc tabulate data= example;
   class grade group subgroup;
   var count;
   table grade,
         group*subgroup=''*count=''*sum=''*f=best5.
         ;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Nov 2018 22:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510096#M72973</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-02T22:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - two across variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510103#M72974</link>
      <description>&lt;P&gt;thanks for the suggestions - continued hunting around, and finally found a solution:&lt;/P&gt;
&lt;P&gt;add MISSING&amp;nbsp;in the Proc Report line, and NOZERO in the across lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input grade type1 $ count1 type2a $ type2b $ count2;
cards;
1 A1 1 . . .
1 B1 1 . . .
1 C1 1 . . .
1 . . A2 A2a 1
1 . . A2 A2b 1
;
run;

proc report data=a &lt;STRONG&gt;missing&lt;/STRONG&gt;;
columns ("Grade" grade)  (type1,(count1))  (type2a, type2b,(count2));
define grade/' ' group;
define type1/' ' &lt;STRONG&gt;nozero&lt;/STRONG&gt; across;
define count1/' ' sum;
define type2a/' ' &lt;STRONG&gt;nozero&lt;/STRONG&gt;  across;
define type2b/' '&lt;STRONG&gt; nozero&lt;/STRONG&gt; across;
define count2/' ' sum;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Nov 2018 00:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-two-across-variables/m-p/510103#M72974</guid>
      <dc:creator>Dave25</dc:creator>
      <dc:date>2018-11-03T00:26:39Z</dc:date>
    </item>
  </channel>
</rss>

