DATA Step, Macro, Functions and more

Read log file while it is still being written

Reply
Occasional Contributor
Posts: 8

Read log file while it is still being written

When I am reading sas log(using program below) file created by some sas program I am getting error message - "ERROR: File is in use," when executing program mentioned below using sas9.2, whereas if I execute below mentioned program using sas9.1.3 I am not getting any error. log file is created using sas9.2. in both cases sas program creating log file was executing..
Can somebody let me know what is happening.

data tmp;
do i=1 to 100;
x="log file path";
output;
end;
run;

data _null_;
set tmp;
infile tmplog filevar=x filename=check2 end=done2 length=_lenvar truncover;
input _logrec_ $varying300. _lenvar;
run;
Super Contributor
Super Contributor
Posts: 3,174

Re: Read log file while it is still being written

Lots of free and helpful Internet resources (hosted DOC, supplemental technical and conference topic-related papers) at the SAS support website http://support.sas.com/ -- consider using the Google search mentioned below.

Also, if necessary, suggest you most your SAS log output with the diagnostic messages (and code) leading up to the error, particular about the INFILE and that file which you must have allocated elsewhere?

Also, for future reference, helpful info about your SAS version, OS platform, whether the program has or has not worked previously (is it new function), whether SAS is installed locally on your machine or on a remote server.

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search argument, this topic / post:

+"file in use" site:sas.com
New Contributor
Posts: 2

Re: Read log file while it is still being written

I have the very same issues between 9.1.3 amd 9.2... Did you get any real helpfull replies yet?
New Contributor
Posts: 2

Re: Read log file while it is still being written

Problem solved by using Options FILELOCKS= ('/xxxxx/xxx' NONE);. Behaviour in 9.2 has changed as it also locks External files.
Ask a Question
Discussion stats
  • 3 replies
  • 546 views
  • 0 likes
  • 3 in conversation