[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: how to read current ALT_LOG on Windows? "file is in use"
From:       "data _null_;" <datanull () GMAIL ! COM>
Date:       2023-06-09 18:06:34
Message-ID: CA+WFKKsss7ht4kRV-5Vjv0j6QLS9eUX_a-bR0pB+L95vMbgP0Q () mail ! gmail ! com
[Download RAW message or body]

Windows FINDSTR may be an adequate replacement for cygwin'd GREP.  I use it
with my regexes that I migrated from LINUX.

On Thu, May 18, 2023 at 12:49 PM Bolotin Yevgeniy <YBolotin@schools.nyc.gov>
wrote:

> System: SAS 9.4 TS1M3 on Windows 10 x64
>
> Short: I want to read a locked text file with SAS (namely, the current
> session's ALT_LOG), but get "file is in use" errors. How do I do this?
>
> Long:
> I'm trying to optimize a bit of code, and replacing an external
> command-line tools with SAS code.
>
> However, one of the things that happen is that the ALT_LOG of the current
> run is parsed and heavily filtered, and then uploaded somewhere.
>
> This is currently done with cygwin'd GREP, which works but is weird, and
> adds a Cygwin dependency that I would like to eliminate.
> I can write an external tool in something Windows-compliant, but seems
> like busywork.
>
> I wrote a log parser in SAS, and it works great... but when I try to
> access the ALT_LOG, I get
> ERROR: File is in use, [my alt_log file]
>
> (same error with proc import and with data step infile)
>
> currently I made a work-around that's just copying the file before reading
> it, but seems hacky, and I wonder if there's a better solution, especially
> since the log can be gigabytes in size.
> X copy &in_file. &out_file.;
>
> ALT_LOG is superior to PROC PRINTTO in this case because it captures all
> activity in the session, which is something I specifically want
>

[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr">Windows FINDSTR may be an adequate replacement for \
cygwin&#39;d GREP.   I use it with my regexes that I migrated from \
LINUX.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On \
Thu, May 18, 2023 at 12:49 PM Bolotin Yevgeniy &lt;<a \
href="mailto:YBolotin@schools.nyc.gov">YBolotin@schools.nyc.gov</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">System: SAS 9.4 TS1M3 \
on Windows 10 x64<br> <br>
Short: I want to read a locked text file with SAS (namely, the current session&#39;s \
ALT_LOG), but get &quot;file is in use&quot; errors. How do I do this?<br> <br>
Long:<br>
I&#39;m trying to optimize a bit of code, and replacing an external command-line \
tools with SAS code.<br> <br>
However, one of the things that happen is that the ALT_LOG of the current run is \
parsed and heavily filtered, and then uploaded somewhere.<br> <br>
This is currently done with cygwin&#39;d GREP, which works but is weird, and adds a \
Cygwin dependency that I would like to eliminate.<br> I can write an external tool in \
something Windows-compliant, but seems like busywork.<br> <br>
I wrote a log parser in SAS, and it works great... but when I try to access the \
                ALT_LOG, I get <br>
ERROR: File is in use, [my alt_log file]<br>
<br>
(same error with proc import and with data step infile)<br>
<br>
currently I made a work-around that&#39;s just copying the file before reading it, \
but seems hacky, and I wonder if there&#39;s a better solution, especially since the \
log can be gigabytes in size.<br> X copy &amp;in_file. &amp;out_file.;<br>
<br>
ALT_LOG is superior to PROC PRINTTO in this case because it captures all activity in \
the session, which is something I specifically want<br> </blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic