<?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 Re: How to combine different RTF file which have different Orientation by using ODS/PROC Document in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190162#M13022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; It is not entirely clear what you mean. ODS DOCUMENT is NOT storing your RTF file. It is storing the OUTPUT OBJECT from your procedure in a "frozen" state imagine that this is what is happening:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) PROC REPORT runs ----&amp;gt; 2) object goes to ODS DOCUMENT and "freezes" before the destination ---&amp;gt; 3) PROC DOCUMENT REPLAY grabs the object and sends to your destination of choice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in this scenario, #1 and #2 can happen on Monday, but #3 can happen on Wednesday. Then with PROC DOCUMENT REPLAY, you can send the objects to ANY ODS destination. Or you can send object from different document stores to the same output. Or you can rearrange objects. But you are NOT storing the "original" ODS RTF output. You are storing a copy of the output object that made the ODS RTF document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For example, in the code below, I am making 2 RTF files and also storing the output objects into a document store:&lt;/P&gt;&lt;P&gt;c:\temp\doc1_make_doc.rtf (2 reports) and c:\temp\doc2_make_doc.rtf (2 reports) -- let's say that I make those 2 RTF files on Friday. And, I also "freeze" the output objects in 1 document store. Then, on Monday, I want to replay the objects all together into 1 RTF file and also in an HTML file. I am not replaying the RTF "file" -- I am replaying the output objects. Normally with ODS DOCUMENT and PROC DOCUMENT if I do a simple REPLAY, then I replay the WHOLE document. But I need to change orientation in the new file. So that means I have to specify which object I want to replay, explicitly -- AND -- I have to switch orientation between objects for the REPLAY. That means I need to know the name of each object that I put in the DOCUMENT store. PROC DOCUMENT will give that information to me. Now, reassembling the output objects together into a NEW report is easy. Please see the screen shot of what the output object names look like in the document store. You should be able to run the attached code, it uses all SASHELP datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I recommend taking a look at the ODS DOCUMENT/PROC DOCUMENT examples. There are several good user group papers (here's mine &lt;A href="http://support.sas.com/resources/papers/sgf09/318-2009.pdf" title="http://support.sas.com/resources/papers/sgf09/318-2009.pdf"&gt;http://support.sas.com/resources/papers/sgf09/318-2009.pdf&lt;/A&gt;) on the subject and even a book in the SAS Bookstore about ODS DOCUMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods document name=work.newreport(write);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** make the original RTF file and store a copy of the output objects in a document store;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf file='c:\temp\doc1_make_doc.rtf';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.class nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "1) SASHELP.CLASS";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.cars(obs=20) nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "2) SASHELP.CARS";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** make the second RTF file and store a copy of the output objects in the same document store;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** could be a different document store, it was easier for this example to make it the same;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf file='c:\temp\doc2_make_doc.rtf';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.classfit nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "3) SASHELP.CLASSFIT";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;format predict lower lowermean upper uppermean 7.2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.Heart(obs=20) nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where cholesterol gt .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;column status sex height weight ageatstart diastolic systolic mrw &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smoking chol_status bp_status weight_status smoking_status;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "4)SASHELP.HEART";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods document close;&amp;nbsp; /* &amp;lt;--- close document store */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** get the names of the output objects;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods listing;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; list / levels=all;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods listing close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** now replay the ALL the separate output objects into 1 RTF file;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** and also make an HTML file as well;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** and switch orientation between objects -- will work for RTF, but orientation is irrelevant to HTML; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf file='c:\temp\playback.rtf';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file='c:\temp\playback.html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#1\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf; run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#2\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf; run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#3\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf; run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#4\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11712i875909EC7CC500F1/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="ods_document_list_of_objects.png" title="ods_document_list_of_objects.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Nov 2014 19:19:45 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2014-11-28T19:19:45Z</dc:date>
    <item>
      <title>How to combine different RTF file which have different Orientation by using ODS/PROC Document</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190161#M13021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have created one RTF file with Portrait orientation and second rtf file with landscape orientation. i have used ODS document to create object for both file and then i wiil call both file by REPLAYin proc document to combine both file into one RTF file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;actually i can do this by using ODS RTF; ..as like below example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************************************************************************&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input name : $20. exp : $20. num ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A same 40&lt;/P&gt;&lt;P&gt;A same 80&lt;/P&gt;&lt;P&gt;A same 90&lt;/P&gt;&lt;P&gt;A same 86&lt;/P&gt;&lt;P&gt;A other 420&lt;/P&gt;&lt;P&gt;A other 300&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data b;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input name : $20. exp : $20. num ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;D other 200&lt;/P&gt;&lt;P&gt;D other 125&lt;/P&gt;&lt;P&gt;D other 230&lt;/P&gt;&lt;P&gt;D other 250&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;options orientation = portrait;&lt;/P&gt;&lt;P&gt;ods rtf file="outputpath\new.rtf" contents=on toc_data;&lt;/P&gt;&lt;P&gt; proc report data=a nowd contents="first table";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; column name exp num ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; define name / display;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; define exp / display;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; define num / display;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;options orientation = landscape;&lt;/P&gt;&lt;P&gt;ods rtf;&lt;/P&gt;&lt;P&gt;proc report data=b nowd contents="second table";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; column name exp num ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; define name / display;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; define exp / display;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; define num / display;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods rtf close;&lt;/P&gt;&lt;P&gt;****************************************************************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i will follow above process then i need to write proc report every time to start new RTF page by ODS RTF statement (cause there are many seperate files will be created and then i need to combine into one file. so every time i can not write PROC REPORT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but suppose i have below dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input name : $20. exp : $20. num ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A same 225&lt;/P&gt;&lt;P&gt;A same 350&lt;/P&gt;&lt;P&gt;A same 40&lt;/P&gt;&lt;P&gt;A same 80&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;D other 230&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;D other 250&lt;/P&gt;&lt;P&gt;D other 45&lt;/P&gt;&lt;P&gt;D other 73&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;**********************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now from this dataset ,i will create two report on the base of name variable by using macro.one report will have PORTRAIT and Other will have LANDSCAPE orientation. macro will contain ODS DOCUMENT statement which store the Object of the report. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i am not getting how can i combine this two rtf file with different orientation by REPLAY in PROC DOCUMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or is there any alternative method to sort out this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope my concern will be clear to you...if not then plz let me know....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 12:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190161#M13021</guid>
      <dc:creator>dharm</dc:creator>
      <dc:date>2014-11-28T12:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine different RTF file which have different Orientation by using ODS/PROC Document</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190162#M13022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; It is not entirely clear what you mean. ODS DOCUMENT is NOT storing your RTF file. It is storing the OUTPUT OBJECT from your procedure in a "frozen" state imagine that this is what is happening:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) PROC REPORT runs ----&amp;gt; 2) object goes to ODS DOCUMENT and "freezes" before the destination ---&amp;gt; 3) PROC DOCUMENT REPLAY grabs the object and sends to your destination of choice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in this scenario, #1 and #2 can happen on Monday, but #3 can happen on Wednesday. Then with PROC DOCUMENT REPLAY, you can send the objects to ANY ODS destination. Or you can send object from different document stores to the same output. Or you can rearrange objects. But you are NOT storing the "original" ODS RTF output. You are storing a copy of the output object that made the ODS RTF document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For example, in the code below, I am making 2 RTF files and also storing the output objects into a document store:&lt;/P&gt;&lt;P&gt;c:\temp\doc1_make_doc.rtf (2 reports) and c:\temp\doc2_make_doc.rtf (2 reports) -- let's say that I make those 2 RTF files on Friday. And, I also "freeze" the output objects in 1 document store. Then, on Monday, I want to replay the objects all together into 1 RTF file and also in an HTML file. I am not replaying the RTF "file" -- I am replaying the output objects. Normally with ODS DOCUMENT and PROC DOCUMENT if I do a simple REPLAY, then I replay the WHOLE document. But I need to change orientation in the new file. So that means I have to specify which object I want to replay, explicitly -- AND -- I have to switch orientation between objects for the REPLAY. That means I need to know the name of each object that I put in the DOCUMENT store. PROC DOCUMENT will give that information to me. Now, reassembling the output objects together into a NEW report is easy. Please see the screen shot of what the output object names look like in the document store. You should be able to run the attached code, it uses all SASHELP datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I recommend taking a look at the ODS DOCUMENT/PROC DOCUMENT examples. There are several good user group papers (here's mine &lt;A href="http://support.sas.com/resources/papers/sgf09/318-2009.pdf" title="http://support.sas.com/resources/papers/sgf09/318-2009.pdf"&gt;http://support.sas.com/resources/papers/sgf09/318-2009.pdf&lt;/A&gt;) on the subject and even a book in the SAS Bookstore about ODS DOCUMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods document name=work.newreport(write);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** make the original RTF file and store a copy of the output objects in a document store;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf file='c:\temp\doc1_make_doc.rtf';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.class nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "1) SASHELP.CLASS";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.cars(obs=20) nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "2) SASHELP.CARS";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** make the second RTF file and store a copy of the output objects in the same document store;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** could be a different document store, it was easier for this example to make it the same;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf file='c:\temp\doc2_make_doc.rtf';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.classfit nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "3) SASHELP.CLASSFIT";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;format predict lower lowermean upper uppermean 7.2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.Heart(obs=20) nowd;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;where cholesterol gt .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;column status sex height weight ageatstart diastolic systolic mrw &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smoking chol_status bp_status weight_status smoking_status;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;title "4)SASHELP.HEART";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods document close;&amp;nbsp; /* &amp;lt;--- close document store */&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** get the names of the output objects;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods listing;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; list / levels=all;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods listing close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** now replay the ALL the separate output objects into 1 RTF file;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** and also make an HTML file as well;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;** and switch orientation between objects -- will work for RTF, but orientation is irrelevant to HTML; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf file='c:\temp\playback.rtf';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods html file='c:\temp\playback.html';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#1\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf; run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#2\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=portrait;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf; run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#3\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;options orientation=landscape;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods rtf; run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc document name=work.newreport;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; replay \Report#4\Report#1\Report#1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11712i875909EC7CC500F1/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="ods_document_list_of_objects.png" title="ods_document_list_of_objects.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 19:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190162#M13022</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-11-28T19:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine different RTF file which have different Orientation by using ODS/PROC Document</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190163#M13023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i got it..i need to write one replay statement for report and one for graph seperately as per my requirement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you so much cynthia for your kind help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 07:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-combine-different-RTF-file-which-have-different/m-p/190163#M13023</guid>
      <dc:creator>dharm</dc:creator>
      <dc:date>2014-12-02T07:19:39Z</dc:date>
    </item>
  </channel>
</rss>

