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 (December 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 20 Dec 2006 15:09:28 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: current proc printto destination
Comments: To: ckxplus@YAHOO.COM
In-Reply-To:  <1166619582.649927.286500@f1g2000cwa.googlegroups.com>
Content-Type: text/plain; format=flowed

ckxplus ,

I still see no good reason to do this. If SAS is already at an alternate output destination simply run

Proc Printto ; Run ;

It will switch it back to the default. If it is already at the default destination the above code will simply do nothing.

If your running a macro and need that macro to output to some destination other than the default, then the destination path should be a paremeter not hard coded in your macro. I have sent many macros back from review to have this fixed. While you are makeing the user work a little and I do stress little harder it does ggive them way more flexability and the code becomes more readable. Plus there is no magic voodoo that the macro does.

Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you walk funny. ~Kathryn Carpenter

From: "ckxplus@yahoo.com" <ckxplus@YAHOO.COM> Reply-To: "ckxplus@yahoo.com" <ckxplus@YAHOO.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: current proc printto destination Date: Wed, 20 Dec 2006 04:59:42 -0800

Whoops, this doesn't work if SAS is run in batch. There's also something weird going on, my macro now crashes SAS 8.2 and 9.12. Back to the drawing board, err, text editor I guess :-(

ckxplus@yahoo.com schreef:

> Thanks, this is more or less the solution I had in mind. But I'm > worried about its robustness too. It works fine if proc printto is in > effect, then it correctly produces the last external file referenced. > But if proc printto is the default destination, then it produces some > other file or directory, the last file opened in SAS for example. A > workaround would be to add the constraint that the proc printto > destination must have a specific extension, e.g. ".out". Something > like: > > proc sql noprint; > > select xpath > into :_printtopath > from dictionary.extfiles > where upcase(xpath) like '%.OUT' and substr(fileref,1,3)="#LN" > having substr(fileref,4)=max(substr(fileref,4)); > quit; > > > &_printtopath will be empty if the printto destination is not a *.out > file. Best solution I suppose but it shouldn't be this hard to find out > what the output destination(s) are and whether they're just text or > also ODS. > > Thanks for the help, > John Hendrickx > > Ya Huang schreef: > > > The last fileref in sashelp.vextfl seems the one you want. Don't know > > if this is robust enough though. > > > > > > proc printto print="c:\temp\xx.txt"; > > > > proc print data=sashelp.class; > > run; > > > > proc sql noprint; > > select xpath into : printtopath > > from > > sashelp.vextfl > > having input(compress(fileref,'#LN'),best.)=max(input(compress > > (fileref,'#LN'),best.)) > > ; > > > > %put &printtopath; > > > > 59 %put &printtopath; > > c:\temp\xx.txt > > > > > > > > > > > > On Tue, 19 Dec 2006 08:02:23 -0800, ckxplus@yahoo.com <ckxplus@YAHOO.COM> > > wrote: > > > > >Is there a way to determine whether proc printto is currently in effect > > >and to store the current proc printto destination in a macro variable? > > >I'd like to reroute some output from within a macro to a temporary > > >destination, then reroute it back to the original proc printto > > >destination. Can this be done? > > > > > >John Hendrickx

_________________________________________________________________ Get free, personalized online radio with MSN Radio powered by Pandora http://radio.msn.com/?icid=T002MSN03A07001


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