<?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 DOCUMENT / REPLAY / ToC with REPORT procedure: two level ToC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845007#M334063</link>
    <description>&lt;P&gt;The following code creates two level ToC (RTF):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nobyline ;

proc sort
   data = sashelp.class
   out  = class
   ;
  by sex ;
run ;

ods listing close ;

ods document
   name = work.L16_2_1
             ( write )
   ;

proc report
   data = class
   contents = " "
   ;
  by sex ;

  column name
          age
          height
          ;
  define name
       / display
         ;
  define age
       / display
         ;
  define height
       / display
         ;
run ;

ods document close ;

proc document
   name = work.L16_2_1 ;

  setlabel \Report#1\ByGroup1#1\Report#1    "L16.2.1 Test label 01 Safety Population Sex = F" ;
  move     \Report#1\ByGroup1#1\Report#1    to ^ ;

  setlabel \Report#1\ByGroup2#1\Report#1    "L16.2.1 Test label 01 Safety Population Sex = M" ;
  move     \Report#1\ByGroup2#1\Report#1    to ^ ;

  delete \Report#1 ;

  ods output properties = properties ;

  list
     / details
       ;
run ;

  ods output close ;


  ods rtf
      file      = "C:\Users\&amp;amp;sysuserid.\Documents\My SAS Files\setlabel_move.rtf"
      style     = styles.fda_tfl
      startpage = bygroup
      contents
      toc_data
      ;

  replay ;
run ;

  ods rtf close ;

quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77424i8488A454808D9B8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This does not occur if I used the PRINT procedure.&amp;nbsp; The "Table 1" does not occur.&amp;nbsp; I would appreciate any corrections, tips, or citations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2022 23:51:31 GMT</pubDate>
    <dc:creator>KevinViel</dc:creator>
    <dc:date>2022-11-17T23:51:31Z</dc:date>
    <item>
      <title>DOCUMENT / REPLAY / ToC with REPORT procedure: two level ToC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845007#M334063</link>
      <description>&lt;P&gt;The following code creates two level ToC (RTF):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nobyline ;

proc sort
   data = sashelp.class
   out  = class
   ;
  by sex ;
run ;

ods listing close ;

ods document
   name = work.L16_2_1
             ( write )
   ;

proc report
   data = class
   contents = " "
   ;
  by sex ;

  column name
          age
          height
          ;
  define name
       / display
         ;
  define age
       / display
         ;
  define height
       / display
         ;
run ;

ods document close ;

proc document
   name = work.L16_2_1 ;

  setlabel \Report#1\ByGroup1#1\Report#1    "L16.2.1 Test label 01 Safety Population Sex = F" ;
  move     \Report#1\ByGroup1#1\Report#1    to ^ ;

  setlabel \Report#1\ByGroup2#1\Report#1    "L16.2.1 Test label 01 Safety Population Sex = M" ;
  move     \Report#1\ByGroup2#1\Report#1    to ^ ;

  delete \Report#1 ;

  ods output properties = properties ;

  list
     / details
       ;
run ;

  ods output close ;


  ods rtf
      file      = "C:\Users\&amp;amp;sysuserid.\Documents\My SAS Files\setlabel_move.rtf"
      style     = styles.fda_tfl
      startpage = bygroup
      contents
      toc_data
      ;

  replay ;
run ;

  ods rtf close ;

quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77424i8488A454808D9B8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This does not occur if I used the PRINT procedure.&amp;nbsp; The "Table 1" does not occur.&amp;nbsp; I would appreciate any corrections, tips, or citations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 23:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845007#M334063</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2022-11-17T23:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: DOCUMENT / REPLAY / ToC with REPORT procedure: two level ToC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845016#M334066</link>
      <description>Hi:&lt;BR /&gt;  The "extra" Table 1 node is unique to PROC REPORT. Here's a Tech Support note about it, with an example of how to suppress it: &lt;BR /&gt;&lt;A href="https://support.sas.com/kb/31/278.html" target="_blank"&gt;https://support.sas.com/kb/31/278.html&lt;/A&gt; .&lt;BR /&gt;&lt;BR /&gt;  My thought is that you'll need to experiment with the workaround shown in the TS note before you create and replay the PROC REPORT output using ODS DOCUMENT.  I'd suggest getting it working before ODS DOCUMENT gets into the mix. But if you can get what you want with PROC PRINT without fiddling with the report, as long as you don't need the features of PROC REPORT, then why not go with PROC PRINT for this?&lt;BR /&gt;Cynthia</description>
      <pubDate>Fri, 18 Nov 2022 00:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845016#M334066</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-11-18T00:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: DOCUMENT / REPLAY / ToC with REPORT procedure: two level ToC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845120#M334092</link>
      <description>&lt;P&gt;Cynthia,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Many thanks for your response.&amp;nbsp; I will read the note and experiment more.&amp;nbsp; I have studied many of your posts and papers.&amp;nbsp; In particular, the ODS MARKUP destination with type = style_popup and stylesheet = "diag.css" has been a gamechanger!&amp;nbsp; In general, we use REPORT extensively, almost even exclusively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 14:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DOCUMENT-REPLAY-ToC-with-REPORT-procedure-two-level-ToC/m-p/845120#M334092</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2022-11-18T14:35:15Z</dc:date>
    </item>
  </channel>
</rss>

