Date: Mon, 2 Feb 2004 22:16:48 -0500
Reply-To: Lou <lpogodajr292185@COMCAST.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lou <lpogodajr292185@COMCAST.NET>
Subject: Re: Printing to the Log window ?
"Mike Rhoads" <RHOADSM1@WESTAT.COM> wrote in message
> Well, it looks like in your example, the output goes to "log.lst" in your
> default directory. I guess LOG must be recognized as a keyword for the
> option but not the PRINT= option (and presumably vice versa), or something
> like that.
> Given that disappointment, off the top of my head I can't come up with
> anything better than using PRINTTO to route your output to a file
> (or catalog entry), and then using a DATA _NULL_ to read it back in a line
> at a time and PUT each line back out to the log. You could probably set
> your options in such a way to make this pretty transparent, although
> obviously it's still a kludge.
> Mike Rhoads
Well, it seems to me that the kludge is trying to do a PROC PRINT to the LOG
window when there's a perfectly fine OUT window, but you never know what
kind of requirements can come down the pike. Here's a small sample
implementing what you suggest - routing the output to a catalog in the WORK
library (so clean up is automatic when the session ends) and then echoing
the printed output to the LOG window.
1 options pageno = 1;
2 data test;
3 do n = 1 to 10;
NOTE: The data set WORK.TEST has 10 observations and 1 variables.
NOTE: The DATA statement used 0.23 seconds.
8 proc printto print = work.test.print.log new;
NOTE: The PROCEDURE PRINTTO used 0.03 seconds.
10 proc print;
NOTE: The PROCEDURE PRINT used 0.0 seconds.
12 proc printto print = print;
NOTE: The PROCEDURE PRINTTO used 0.01 seconds.
14 filename xx catalog 'work.test.print.log';
15 data _null_;
16 infile xx;
18 put _infile_;
NOTE: The infile XX is:
Catalog Page Size=4096,
Number of Catalog Pages=3,
Created=22:01 Monday, February 2, 2004,
Last Modified=22:01 Monday, February 2, 2004
The SAS System 22:01
Monday, February 2, 2004 1
NOTE: 14 records were read from the infile XX.
The minimum record length was 0.
The maximum record length was 102.
NOTE: The DATA statement used 0.03 seconds.
20 filename xx clear;
NOTE: Fileref XX has been deassigned.
No new material below - included for reference only
> -----Original Message-----
> From: Richard A. DeVenezia [mailto:radevenz@IX.NETCOM.COM]
> Sent: Monday, February 02, 2004 2:40 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Printing to the Log window ?
> Is there a way to print to the log window ?
> I tried
> ods listing;
> proc printto print=log; run;
> proc print data=sashelp.class;
> proc printto print=print; run;
> It runs, but I don't know where the proc print output went.
> Richard A. DeVenezia