BookmarkSubscribeRSS Feed
KevinViel
Pyrite | Level 9

The following code creates two level ToC (RTF):

 

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\&sysuserid.\Documents\My SAS Files\setlabel_move.rtf"
      style     = styles.fda_tfl
      startpage = bygroup
      contents
      toc_data
      ;

  replay ;
run ;

  ods rtf close ;

quit ;

Untitled.jpg

 

This does not occur if I used the PRINT procedure.  The "Table 1" does not occur.  I would appreciate any corrections, tips, or citations.

 

Thank you,

 

Kevin

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
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:
https://support.sas.com/kb/31/278.html .

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?
Cynthia
KevinViel
Pyrite | Level 9

Cynthia,

 

  Many thanks for your response.  I will read the note and experiment more.  I have studied many of your posts and papers.  In particular, the ODS MARKUP destination with type = style_popup and stylesheet = "diag.css" has been a gamechanger!  In general, we use REPORT extensively, almost even exclusively.

 

Best regards,

 

Kevin 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 489 views
  • 1 like
  • 2 in conversation