The SAS Output Delivery System and reporting techniques

proc reporting line breka and spacing issue!!!!!!

Regular Contributor
Posts: 171

proc reporting line breka and spacing issue!!!!!!

Hello Sir,

I have a question in proc reporting.

final dataset looks like

term              acterm                 pterm                   trt1                 trt2            total  

aterm1            aterm1                                            99                    98             197

  pterm1          aterm1                   pterm1                 1                      2               3

  pterm2          aterm1                   pterm2                 5                      6               11

  pterm3          aterm1                   pterm3                 2                     4                 6


aterm2            aterm2                                             220                210               450

pterm4           aterm2                   pterm4

pterm5            aterm2                 pterm5

pterm6            aterm2                 pterm6

pterm7            aterm2                 pterm7

pterm8            aterm2                 pterm8

...                   .........                .........

...                       ......                 ........

pterm10            .........                 pterm10                 10              20                   30






1450 term(aterm80 ,under aterm pterm are presented)

My question is gor the values and everything right. But in RTF i need to present like only term, trt1 trt2 total

in term variable first row is aterm and intended with pterm,

Im using proc report to produce rtf.

the final ouput is like break after aterm/skip(i mean i need a space highlghted in red color(1,2) these represents space

in term variable if page break before the pterm1,pterm4 then aterm1 are also show in next page

RFT output;





(need space)




                                                           page break(if page break is happens like this)

in next pagee




  p term7

(need space)

aterm3                                                    pagebreak(if it happens like this) this line should be moved into next page

in next page





I hope i explained clearly. Please help me out

I am wondering if some body will give helpful tip on this issue. This is all about line break...the data  is all about AETERMS and using break after ,but some where in the RTF. aterm in one page and pterms in another page....

Thanks in advance


Posts: 9,373

proc reporting line breka and spacing issue!!!!!!


  It is extremely hard to visualize/understand what your question is. It seems that you have some line breaking issues and that your issues exist in ODS RTF output only and that you are using PROC REPORT.

  I know that it is hard to explain what the RTF file looks, especially when you explain the problem by pasting some  non-RTF  text into the forum posting mechanism. In instances like this, where the -real- output is important to the understanding of the problem, it would be useful if you did one of two things in order to help the forum participants help you:

1) either create a program that replicates enough of your data (or a fake version of your data) to produce the problem with the PROC REPORT code...this will entail a DATA step program and a PROC REPORT program (including ODS statements)


2) post only your PROC REPORT code (and ODS statements) and a screen shot of the page-breaking issue shown when your RTF file is opened in WORD.

  The advantage of #1 is that folks can grab your program and run it with some sample data in order to see EXACTLY what the issue is. And, you make it possible for them to alter the code to see if they can achieve the change you want. The advantage of #2 is that folks can see the same thing that you're seeing when the RTF file is opened. And if you show ALL your PROC REPORT code, they can sort of figure what the REPORT code is doing. But, the disadvantage of #2 is that every person who is willing to help you has to make up some data in order to run your program. Generally, when you post on the forum, if you do not have popups blocked or security restrictions, you should be able to post code and/or screen shots to the forum. Sometimes, you need to go into Advanced Editor mode in order to paste screen shots and TXT files. If you do not know how to make up a fake data file for testing and/or you cannot post the data or program to the forum, then your best resource for help is to work with Tech Support -- to send them the actual data and the actual output and the actual program that you are having trouble with.

  You say, in your original post, that you are showing your "dataset" but what you show at the top of your post looks like an output report to me instead of an input dataset. It is almost impossible to make constructive comments without seeing your PROC REPORT code, including ODS statements surrounding the REPORT code. For example, which items are ORDER items or GROUP items? What are your BREAK and RBREAK statements? Do you use the PAGE option on your BREAK statements? Are there any LINE statements in your code??

  Last, this looks like something to do with clinical data. Have you looked at the archive of papers on the site -- in particular, the PharmaSUG papers that are archived on this site. The PharmaSUG papers have many, many examples of producing report for clinical situations.


Regular Contributor
Posts: 171

proc reporting line breka and spacing issue!!!!!!

Posted in reply to Cynthia_sas

THnaks for your reply Cynthia!!!!! The final RTF is as shown below.

          ATCTERM/PTERMS                                                                          trt1              trt2                total

Subjects with >=1 Concomitant Med                                                        100 ( 99.6)      900 ( 98.8)     1000 ( 99.2)                    


3-OXOANDROSTEN (4) DERIVATIVES                                                        8 (  0.8)        1 (  0.2)             9 (  0.5)                 TESTOSTERONE                                                                                      4 (  0.8)        7 (  0.2)              5 (  0.5)                      


ACE INHIBITORS AND CALCIUM CHANNEL BLOCKERS                            7(  1.2)        2 (  0.4)              9 (  0.8)                  

   AMLODIPINE BESYLATE W/BENAZEPRIL HYDROCHLOR.                     9 (  1.2)        2 (  0.4)              8 (  0.8)                 


ACE INHIBITORS AND DIURETICS                                                            63(  1.2)        0 (  0.0)               63 (  0.6)                   

   BI PREDONIUM                                                                                    2 7(  0.4)        0 (  0.0)                2 (  0.2)                     

   CIBADREX                                                                                           10(  0.2)        0 (  0.0)                 1 (  0.1)                      

   SALUTEC                                                                                            14 (  0.2)        0 (  0.0)                 1 (  0.1)                      

   ZESTORETIC                                                                                         2 (  0.4)        0 (  0.0)                 2 (  0.2)                     


ACE INHIBITORS, PLAIN                                                                      104 ( 20.6)      115 ( 22.7)           219 ( 21.6)                      

   BENAZEPRIL                                                                                       8 (  1.6)        6 (  1.2)                14 (  1.4)                      

   CAPTOPRIL                                                                                         5 (  1.0)        2 (  0.4)                  7 (  0.7)                       

   CILAZAPRIL                                                                                         1 (  0.2)        0 (  0.0)                  1 (  0.1)                       

   ENALAPRIL                                                                                       20 (  4.0)       32 (  6.3)                52 (  5.1)      

Suppose if it breaks after at this place in need in next page like

ACE INHIBITORS, PLAIN (cont)               

   FOSINOPRIL                                                                                        1 (  0.2)        2 (  0.4)                  3 (  0.3)                      

   IMIDAPRIL                                                                                            1 (  0.2)        0 (  0.0)                  1 (  0.1)                      

   LISINOPRIL                                                                                         49 (  9.7)       52 ( 10.3)             101 ( 10.0)                    

   PERINDOPRIL                                                                                      3 (  0.6)        3 (  0.6)                   6 (  0.6)                     

   QUINAPRIL                                                                                          0 (  0.0)        5 (  1.0)                    5 (  0.5)   

ADRENERGICS AND OTHER DRUGS FOR OBSTRUCTIVE AIRWAY        10 (  2.0)       14 (  2.8)                  24 (  2.4)                       

   BUDESONIDE W/FORMOTEROL FUMARATE                                        1 (  0.2)        1 (  0.2)                     2 (  0.2)                      

   COMBIVENT                                                                                         1 (  0.2)        2 (  0.4)                     3 (  0.3)                       

   FORMOTEROL W/BUDESONIDE                                                           1 (  0.2)        0 (  0.0)                     1 (  0.1)                       

   SERETIDE                                                                                            8 (  1.6)       12 (  2.4)                  20 (  2.0)           .           

This is the table RTF      i was highlited "ACE INHIBITORS, PLAIN (cont)"

term                                                                           trt1                          trt2                    total








  pterms so on












(if page break was here then i need to show the ATCTERM on next page like atcterm+(cont)  ACE INHIBITORS, PLAIN (cont)

On Next page

ATCTERM2 (cont)












   like so on


I am getting everthing right(correct) in final RTF the breaks and space every thing as i shownws in above final RTF. The only thing is not getting is, if pterm is break at the end of the page and continued in next page i need to show an extra line with ATCTERM2 (cont) in required pages

Thanks in advance


Posts: 9,373

proc reporting line breka and spacing issue!!!!!!


  You have a fairly standard "demographic" report showing the N and PCTN being created with ODS RTF and PROC REPORT. It is entirely possible that someone at your company has already produced a report such as you want -- it might be worthwhile to check previous trials and their programs to see what programs might already be in existence for re-use.

  Generally, for a report of this nature, if it is important to control the page breaks in the way you describe, most folks will "pre-process" the data file for PROC REPORT and will put a "fake" page break variable into the data file. Then, they make that "fake" page break number an ORDER or GROUP item with NOPRINT. Then in a COMPUTE BEFORE _PAGE_, or a COMPUTE BEFORE "fake page break variable", they will write out the line they need for continuation. These Tech Support notes

show the use of a "fake" page break variable which gives the general idea. Although they do not show a COMPUTE block, it would be possible to build a COMPUTE block with a LINE statement.

  Alternatively, if you use TAGSETS.RTF with the SPANROWS and UNIFORM options and a table splits across pages, you can automatically get the word (continued) at the bottom of the page and the GROUP or ORDER item repeated at the top of the next page

--sometimes this is adequate for demographic reports such as you describe.

  Again, seeing your PROC REPORT code might be helpful. Since you did not show any of your input data or your PROC REPORT code and ODS statements, you did not provide any way for someone to run equivalent code.

  Searching on or even searching the forums might reveal more examples of both the above techniques

(such as these: or or or or or

  For more complete help, you may want to open a track with Tech Support, because they can look at all your PROC REPORT code -and-  your INPUT data set -and- your output RTF file.


Ask a Question
Discussion stats
  • 3 replies
  • 2 in conversation