<?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: Question for Proc Report of Across with different number of obs in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/493246#M21639</link>
    <description>&lt;P&gt;Thanks very much!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 02:20:06 GMT</pubDate>
    <dc:creator>jsbyxws</dc:creator>
    <dc:date>2018-09-07T02:20:06Z</dc:date>
    <item>
      <title>Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490696#M21546</link>
      <description>&lt;P&gt;Not sure how to do proc report with across.&amp;nbsp;&amp;nbsp;I have a sample dataset like below for school, Math score, English score:&lt;/P&gt;&lt;P&gt;School1&amp;nbsp;91 91&lt;BR /&gt;School1&amp;nbsp;92 92&lt;BR /&gt;School1&amp;nbsp;93 93&lt;BR /&gt;School2 81 81&lt;BR /&gt;School2&amp;nbsp;82 82&lt;BR /&gt;School3 71 71&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to proc report with school across and show in new page, i.e.&amp;nbsp;&lt;/P&gt;&lt;P&gt;in page1:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; School1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;math&amp;nbsp; &amp;nbsp; English&lt;/P&gt;&lt;P&gt;91&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 91&lt;/P&gt;&lt;P&gt;92&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 92&lt;/P&gt;&lt;P&gt;93&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 93&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in a new page (here page 2 since page1 already has all for school1. In reality if school1 has more pages, school2 always start at new page):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt; School2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;math&amp;nbsp; &amp;nbsp; English&lt;/P&gt;&lt;P&gt;81&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 81&lt;/P&gt;&lt;P&gt;82&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 82&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;similary for school3 in a new page like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt; School3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;math&amp;nbsp; &amp;nbsp; English&lt;/P&gt;&lt;P&gt;71&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;7&lt;/SPAN&gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 02:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490696#M21546</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-08-29T02:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490798#M21549</link>
      <description>&lt;P&gt;CODE NOT TEST&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;options nobyline;&lt;/P&gt;
&lt;P&gt;title ' #byval1 ';&lt;/P&gt;
&lt;P&gt;proc report data=have nowd;&lt;/P&gt;
&lt;P&gt;by school;&lt;/P&gt;
&lt;P&gt;column math english;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 11:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490798#M21549</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-08-29T11:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490825#M21550</link>
      <description>&lt;P&gt;Ksharp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for the code!&amp;nbsp; I tested and output to pdf. It did start a new page for each school. But there is only one line for total (I guess it uses SUM). Is there any option to list them as it is? BTW, before proc report, I did add proc sort if you happen to use the code to test.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 13:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490825#M21550</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-08-29T13:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490873#M21551</link>
      <description>Hi:&lt;BR /&gt;  Since MATH and ENGLISH are numeric, their default usage is ANALYSIS with a STATISTIC of SUM. So if you want each row to be displayed, you have to provide explicit DEFINE statements:&lt;BR /&gt;DEFINE Math / display;&lt;BR /&gt;DEFINE English / display;&lt;BR /&gt;&lt;BR /&gt;  In this case, you are NOT using ACROSS items at all.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 29 Aug 2018 14:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/490873#M21551</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-08-29T14:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491000#M21558</link>
      <description>&lt;P&gt;Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for help! It works! As you said "across" pages is not "across any more. So define instead of analysis will work.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 21:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491000#M21558</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-08-29T21:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491246#M21567</link>
      <description>&lt;P&gt;Got another question about proc report with &lt;STRONG&gt;by variable&lt;/STRONG&gt;. This is the sample SAS program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; input SchoolN Math $ English $;&lt;BR /&gt;datalines;&lt;BR /&gt;1 Albert Alice&lt;BR /&gt;1 Adam Amanda&lt;BR /&gt;2 Ben Brenda&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; label SchoolN="School Name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; value SchoolN 1="School 1" 2="School 2" 3="School 3";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by schoolN;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; format schoolN schoolN.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; column Math English;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; define Math /display;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; define English /display;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With &lt;STRONG&gt;by variable&lt;/STRONG&gt;, it DOES print in a new page for each school. But the school shows up as "&lt;STRONG&gt;School Name=&lt;/STRONG&gt;School 1" for page 1 and "&lt;STRONG&gt;School Name=&lt;/STRONG&gt;School 2" for page 2. How to remove &lt;SPAN&gt;"&lt;STRONG&gt;School Name=&lt;/STRONG&gt;"&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, when I insert&amp;nbsp;&lt;STRONG&gt;title '#byval1';&lt;/STRONG&gt;&amp;nbsp;inside proc report, it works. Now "&lt;STRONG&gt;School Name=&lt;/STRONG&gt;" is gone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Ksharp and Cythia, thanks! I saw your other post for above solution.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 14:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491246#M21567</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-08-30T14:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491322#M21571</link>
      <description>&lt;P&gt;Hi, I am now stuck with another issue in proc report with by variable: my column header depends on "by variable", how to show them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume original data has 3 columns: school number, honor students, number of students at school.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data have;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; input SchoolN Math $ N;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 Albert 100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 Adam 100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 Ben 200&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to show in proc report each school starting a new page. I got it wit &lt;STRONG&gt;by SchoolN&lt;/STRONG&gt;. But I also want to show header for Math total number of students for that school, i.e. column header depends on by variable. How to do it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I want the report for each school to show&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 16:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491322#M21571</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-08-30T16:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491377#M21576</link>
      <description>&lt;P&gt;Just consulted with some SAS guru and found the detour solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technically in &lt;STRONG&gt;ONE&lt;/STRONG&gt; proc report, you cannot use a macro in header if it &lt;STRONG&gt;depends on the by variable&lt;/STRONG&gt;! But there are solutions to this: use &lt;STRONG&gt;multiple&lt;/STRONG&gt; proc reports one after another. They will show up in&amp;nbsp;ONE pdf/rtf file.&amp;nbsp; Each proc report will use "&lt;STRONG&gt;title '#byval1';&lt;/STRONG&gt;" with by variable in proc report. In each proc report, column header will use macro variable which can be explicitly called (of course you have to create them first for each value of by variable).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, need to create 2 macro variables for two schools, say :N1=100 and :N2=200. Then &amp;amp;N1 will be used in column header&amp;nbsp;for&amp;nbsp;proc report with SchoolN=1. Likewise for &amp;amp;N2.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 18:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491377#M21576</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-08-30T18:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491626#M21586</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input SchoolN Math $ N;
datalines;
1 Albert 100
1 Adam 100
2 Ben 200
;
run;

options nobyline;
title 'school is #byval1';
proc report data=have nowd;
by schoolN;
column math n;
define math/display;
define N/analysis sum;

compute before _page_;
line 'School  has total  '  n.sum;
endcomp;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Aug 2018 13:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/491626#M21586</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-08-31T13:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Question for Proc Report of Across with different number of obs</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/493246#M21639</link>
      <description>&lt;P&gt;Thanks very much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 02:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Question-for-Proc-Report-of-Across-with-different-number-of-obs/m-p/493246#M21639</guid>
      <dc:creator>jsbyxws</dc:creator>
      <dc:date>2018-09-07T02:20:06Z</dc:date>
    </item>
  </channel>
</rss>

