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.
DDS Data Extraction
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> 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
> DATA steps. Then I redirect the log back to the log window and parse
> log file to check for errors (don't ask...it has to be done this way).
> works, but the problem is related to re-directing the log back to the
> window (using LOG=LOG).
> The problem is that before this section of code was submitted, the log
> have already been directed to a particular log file, not the window.
> this case, I do not want to simply redirect the log back to the log
> 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
> that I don't have to keep track of the last log file. In some cases, I
> 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
> 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.