DATA Step, Macro, Functions and more

How to use spanrows option with plain rtf (no tagsets)?

Reply
Occasional Contributor
Posts: 11

How to use spanrows option with plain rtf (no tagsets)?

Hi There,

I am using SAS 9.3 M1. I am unsuccessful in using the spanrows option in a plain rtf (no tagsets) output. It is working wonderful in the pdf destination but not with the rtf. It is combining all the rows into one cell but when the page breaks the row is not appearing in the new page. Is there any other option/statement I need to use with? Your advice will be appreciated.

Below is a sample test code.

data class30;

set sashelp.class;

do check = 1 to 30;

output;

end;

run;

ods rtf file ="&outpath.\class30.rtf";

proc report data=class30 nowd out=show spanrows;

column age name check sex;

define age /order;

define name / order ;

run;

ods rtf close;

Thanks,

Sunil

SAS Super FREQ
Posts: 8,743

Re: How to use spanrows option with plain rtf (no tagsets)?

Hi:

  It is strange that you do not want to use TAGSETS.RTF. Is there a reason for this requirement? That is really the solution to your issue in this case. If you run the code (a modification of your  test), you will see exactly the output you want from the TAGSETS.RTF destination. Because TAGSETS.RTF does vertical measurement, and inserts explicit page breaks, Word knows exactly where to put the page break and the value repeats across pages. See the example in the attached screenshot, where the rows for Thomas split across pages. This output was created using TAGSETS.RTF.

cynthia

data class30;

set sashelp.class;

do check = 1 to 30;

    output;

end;

run;

 

ods pdf file="c:\temp\class30.pdf";

ods rtf file ="c:\temp\class30.rtf";

ods tagsets.rtf file ="c:\temp\class30tr.rtf"

    options(doc='help' continue_tag='no');

proc report data=class30 nowd spanrows;

column age name check sex;

define age /order;

define name / order ;

run;

ods _all_ close;


tagsets_rtf_spanrows.png
Occasional Contributor
Posts: 11

Re: How to use spanrows option with plain rtf (no tagsets)?

Thank you very much Cynthia. I will try using the tagsets. The reason I did not use tagsets is with plain RTF, I am getting everything what I require except the spanning of rows. Initially when I tried using the tagsets, I got all wierd page breaks, "Continued" text, and rtf codes (ex: \tq\b, \tqr\tx14050 ) etc. These did not happen after I shifted to plain rtf. (I am creating a define file where I am including multiple proc reports with different options for each (ex: startpage), under single ODS sandwich to have a single file).

Sunil

Ask a Question
Discussion stats
  • 2 replies
  • 559 views
  • 0 likes
  • 2 in conversation