Date: Wed, 20 Dec 2006 03:02:09 -0800
Reply-To: "email@example.com" <ckxplus@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "firstname.lastname@example.org" <ckxplus@YAHOO.COM>
Subject: Re: current proc printto destination
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
proc sql noprint;
where upcase(xpath) like '%.OUT' and substr(fileref,1,3)="#LN"
&_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
Thanks for the help,
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;
> proc sql noprint;
> select xpath into : printtopath
> having input(compress(fileref,'#LN'),best.)=max(input(compress
> %put &printtopath;
> 59 %put &printtopath;
> On Tue, 19 Dec 2006 08:02:23 -0800, email@example.com <ckxplus@YAHOO.COM>
> >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