LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 6 Mar 2001 18:55:50 -0500
Reply-To:     Ray Pass <raypass@ATT.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ray Pass <raypass@ATT.NET>
Subject:      Re: Duplicate Reports with ODS
In-Reply-To:  <15104802790BD411A2C100D0B73EA33CE0A511@remailnt3-re01.west
              at.com>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Dianne, Kim, et al.

I am NOT the ODS guy. I know a little stuff and I like teaching what I know, but it's way limited.

On this question, I do know that while the ODS HTML destination is open (in between the ODS HTML... command and the ODS HTML CLOSE command) output is being sent to the various files (BODY, CONTENTS, PAGE, FRAME) identified in the most recent ODS HTML... command issued. You can send multiple pieces of output to the same file(s) by running multiple procs before changing the files being written to with a new ODS HTML... command. AFAIK, you can not have two BODY files, etc. open at the same time for output.

As the ODS manual says on page 78 (ODS HTML example 2), "You must close the destination before you can view the output with a browser." You close the HTML destination with the ODS HTML CLOSE command. I think that that is when the "bottom matter" gets written to whichever ODS HTML files were opened previously. You can write as many pieces of proc output as you like to a single BODY file before closing it. I would say however that the only way to currently (pre 8.2) write the same piece of proc output to multiple files is to run the proc multiple times, with different ODS BODY file open before each run. You could of course also create copies of the HTML output files with different names. Don't forget that the files created are totally external to SAS and are just ASCII files.

You can also manipulate (omit) the "top matter" (opening HTML stuff) and "bottom matter" (closing HTML stuff) in the file being created by ODS. This is useful to add text comments in between pieces of output in the same output file, or DATA step output via the ODS Data Step connection. I recently used this technique by running two separate TABULATEs, each with by-group processing, leaving off the closing HTML code in the output from the first TABULATE (NO_BOTTOM_MATTER) and leaving off the opening HTML code in the output from the second TABULATE (NO_TOP_MATTER), and then joining the separate outputs from each by-group with external operating system commands (UNIX: cat file2.htm >> file1.htm) via macro loops. A key feature in this technique is using NEWFILE=BYGROUP in the HTML ODS... commands - this is only available in 8.1 on. Very cool stuff.

I HTH.

Ray

At 04:07 PM 03/06/2001 -0500, Dianne Rhodes wrote: >Kim LeBouton <Kimberly_LeBouton@AHM.HONDA.COM> wrote: > > Subject: Duplicate Reports with ODS > > I want to create the same HTML report but have it directed to two >different > > locations. (I added the RTF to see if I could get two reports.) > > > The code below only produces an HTML report for the last ODS HTML >statement > > (i.e., the one with &sysdate). Is it possible to get two HTML reports >with > > only one PROC PRINT run? > >Well that makes sense doesn't it? The last one referenced. >No, I don't think you can do it with one proc print. > > > ods rtf file='c:\downloads\creatertf.rtf'; > > ods html file="c:\downloads\createhtml.htm"; > > ods html file="c:\downloads\create&sysdate..htm"; > > proc print data=sasuser.class; > > run; > > ods html close; > > ods rtf close; > > ods html close; > >It's my understanding (from a paper given by Ray Pass) that the html only >gets written >after the HTML close is issued. His paper, which I think was presented at >SUGI 25, >(or maybe it was NESUG, they all blur together) >shows how to manipulate what is written to the html file, and AFAIR >demonstrated >writing to the same file more than once, by manipulating when the bottom of >the html is written. >I can't seem to put my finger on that particular paper at the moment, >perhaps Ray will speak up. > > >Dianne Louise Rhodes >Sr. Systems Analyst >Westat >(x01) 315-5977 work >(x01) 315-5934 fax

*------------------------------------------------* | Ray Pass, Ph.D. voice: (914) 693-5553 | | Ray Pass Consulting eFax: (914) 206-3780 | | 5 Sinclair Place | | Hartsdale, NY 10530 e-mail: raypass@att.net | *------------------------------------------------*


Back to: Top of message | Previous page | Main SAS-L page