|
Lorne -
Don't know of a way to determine where log or output are routed after
the fact. Interestingly, although you can use "log" as a fileref and
write things into your printto log file, the pathname function does not
return its path.
You could set a couple global macro variables to keep track of your
current and last printto locations. Whenever you use a printto command
you'd reset the two variables. This could be wrapped in a macro that
executes your printto, so all you'd need to do is run the macro instead
and specify the changed file location or return to the previous.
hth
Paul Choate
DDS Data Extraction
(916) 654-2160
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Lorne
> Klassen
> Sent: Wednesday, February 22, 2006 1:27 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Current PROC PRINTTO log file??
>
> I'm using PROC PRINTTO to redirect the log to a file before running
three
> DATA steps. Then I redirect the log back to the log window and parse
the
> log file to check for errors (don't ask...it has to be done this way).
> This
> works, but the problem is related to re-directing the log back to the
log
> window (using LOG=LOG).
>
> The problem is that before this section of code was submitted, the log
may
> have already been directed to a particular log file, not the window.
In
> this case, I do not want to simply redirect the log back to the log
window
> at the end. I really want to direct the log back to the file it was
> originally being written to. But I want to write the code generically
such
> that I don't have to keep track of the last log file. In some cases, I
may
> have been originally writing to the log window, not to a file at all.
>
> So what I need is some way to get the file that the log is currently
being
> directed to, or, "LOG" if it is currently going to the log window. I
> couldn't find an option that stores this value. I'm using 9.1.
>
> Thanks
|