<?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 PROC REPORT in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810883#M25755</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daily1_0-1651399534950.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71046i07F67B1B3E4ED167/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daily1_0-1651399534950.png" alt="Daily1_0-1651399534950.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to create this type of table using proc report&lt;/P&gt;</description>
    <pubDate>Sun, 01 May 2022 10:05:45 GMT</pubDate>
    <dc:creator>Daily1</dc:creator>
    <dc:date>2022-05-01T10:05:45Z</dc:date>
    <item>
      <title>PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810543#M25745</link>
      <description>&lt;P&gt;HOW TO WRITE PROC REPORT CODE FOR THIS TABLE&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daily1_0-1651215298503.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70973i9C403610968C8E04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daily1_0-1651215298503.png" alt="Daily1_0-1651215298503.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;proc report data=WORK;&lt;BR /&gt;column A B C (("D" F G) G&lt;BR /&gt;("H" I ('J' K L M) N);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 06:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810543#M25745</guid>
      <dc:creator>Daily1</dc:creator>
      <dc:date>2022-04-29T06:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810547#M25746</link>
      <description>&lt;P&gt;Please supply usable example data for us to play around with.&lt;/P&gt;
&lt;P&gt;(Usable = data step with datalines)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I take it that D, H and J should be literal strings used as headers?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 07:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810547#M25746</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-29T07:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810567#M25747</link>
      <description>dataline;&lt;BR /&gt;A B C E F G I K L M N&lt;BR /&gt;1 japan 190 46 15 0 0 0 0 0 1&lt;BR /&gt;2 us 152 39 47 86 0 0 0 0 1&lt;BR /&gt;3 aus 50 6 36 41 0 0 0 0 1&lt;BR /&gt;&lt;BR /&gt;D, H and J is strings used as headers</description>
      <pubDate>Fri, 29 Apr 2022 10:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810567#M25747</guid>
      <dc:creator>Daily1</dc:creator>
      <dc:date>2022-04-29T10:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810574#M25748</link>
      <description>&lt;P&gt;This is what we mean by "data step with datalines":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input A B $ C E F G I K L M N;
datalines;
1 japan 190 46 15 0 0 0 0 0 1
2 us 152 39 47 86 0 0 0 0 1
3 aus 50 6 36 41 0 0 0 0 1
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is not rocket science, so you can do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The nearest thing I can come up with is this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have;
column ("A" ("" A)) ("B" ("" B)) ("C" ("" C)) ("D" (("E" E) ("F" F))) ("G" ("" G))
("H" ("I" I) ('J' K L M) ("N" N));
define A / "" display;
define B / "" display;
define C / "" display;
define E / "" display;
define F / "" display;
define G / "" display;
define I / "" display;
define K / display;
define L / display;
define M / display;
define N / "" display;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I guess&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;can come up with something that also does the alignment and the border lines.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 10:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810574#M25748</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-29T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810579#M25749</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daily1_0-1651229618725.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70979iEA5988D86E15699F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daily1_0-1651229618725.png" alt="Daily1_0-1651229618725.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i want this type&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daily1_1-1651229674586.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70980i546BD6FEB93718F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daily1_1-1651229674586.png" alt="Daily1_1-1651229674586.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 10:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810579#M25749</guid>
      <dc:creator>Daily1</dc:creator>
      <dc:date>2022-04-29T10:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810743#M25751</link>
      <description>&lt;P&gt;Thanks for your faith in me &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; but this is harder to adjust than you'd think. In Excel, you can achieve row spanning and column spanning fairly easily which is what the desired picture of the headers looks like something from Excel. The challenge with that is that PROC REPORT does 1 row at a time on the report. The first header row, then the next header row, then however many header rows, then the data rows. But, here's the challenge, when the first header row is placed on the report, it can't be changed. So when the second header row might have nested spanning headers, PROC REPORT will NOT go back and adjust any of the headers in the first row that might look better if they were adjusted. So, while this might be possible to achieve using some helper variables, as shown in this paper &lt;A href="https://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf&lt;/A&gt; on pages 11-13 -- it's not exactly the same scenario, but the concept is somewhat similar.&lt;BR /&gt;&lt;BR /&gt;It might also be easier to accomplish using the row spanning and column spanning capabilities of the Report Writing Interface. In doing some preliminary analysis, since I have limited time today, this is what I came up with. It appears to me that the headers have both horizontal and vertical spanning that is desired, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1651264631720.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70996i0B018EA62A5BA800/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1651264631720.png" alt="Cynthia_sas_0-1651264631720.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;But PROC REPORT isn't good at this (vertical and horizontal spanning). I suspect that either the column spanning will work, but then some headers might appear on the wrong rows. One issue is that there will be column borders that won't match what is desired. And remember that PROC REPORT is writing 3 distinct report header rows so it's a lot of fiddly work to get it so everything spans correctly. PROC REPORT is NOT going to truly "merge across" or "merge down" the way that Excel would do.&lt;BR /&gt;&lt;BR /&gt;This is the best focus I can devote to this now. Just looking at it, I think the in the end, PROC REPORT isn't going to be able to do the job and this might be something that needs to be done with the Report Writing Interface. If I have time I can try to poke around and see whether I can make it work in PROC REPORT, but I have a hunch that in the end it won't be what is desired.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS -- had a chance to test out my theory with helper variables to make "fake" header columns. Thanks Kurt for the code to use as a starter. Here's the best that I think can be achieved with PROC REPORT without a LOT more fiddling and I'm not even sure the fiddling would work:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1651267205749.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70998i09FBC00818AA8014/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1651267205749.png" alt="Cynthia_sas_0-1651267205749.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But even with the fake helper variables as ACROSS items, you can see that the row 1 spacing and row 2 spacing vertically is not what was depicted by the original poster.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1651267667354.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70999i599FFF43BA6C0136/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1651267667354.png" alt="Cynthia_sas_1-1651267667354.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 21:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810743#M25751</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-04-29T21:28:12Z</dc:date>
    </item>
    <item>
      <title>PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810883#M25755</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daily1_0-1651399534950.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71046i07F67B1B3E4ED167/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daily1_0-1651399534950.png" alt="Daily1_0-1651399534950.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to create this type of table using proc report&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 10:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810883#M25755</guid>
      <dc:creator>Daily1</dc:creator>
      <dc:date>2022-05-01T10:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810886#M25756</link>
      <description>&lt;P&gt;Please provide (a portion of) the data as SAS data step code, which you can type in yourself or use this &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;macro&lt;/A&gt;, and not in any other form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236411"&gt;@Daily1&lt;/a&gt; you have &lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810547#M25746" target="_self"&gt;previously been asked&lt;/A&gt; to provide data in a usable form, please do that from now on, without making us ask each time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 10:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810886#M25756</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-01T10:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810894#M25757</link>
      <description>&lt;P&gt;I moved your post into here, where you already asked a similar question. Please provide data following my example.&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 11:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT/m-p/810894#M25757</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-01T11:00:27Z</dc:date>
    </item>
  </channel>
</rss>

