Date: Wed, 20 Dec 2006 03:02:09 -0800
Reply-To: "ckxplus@yahoo.com" <ckxplus@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "ckxplus@yahoo.com" <ckxplus@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: current proc printto destination
In-Reply-To: <200612191724.kBJFxivV001403@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
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
|