DATA Step, Macro, Functions and more

Writing to a log file

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 114
Accepted Solution

Writing to a log file

I have been using the following code to write to a log file while running a program to avoid the log containing the output.

 
proc printto log='/folders/myfolders/BootRIT/filenOLD.LST/';

However I get this error while running SAS University edition.

 

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 /*PROGRAM TAKES A CONTROL FILE AND DUPLICATES IT N TIMES*/
63 /*THE $DATA LINE IS ALSO CHANGED TO MATCH THE FILE NAME*/
64 proc printto log='/folders/myfolders/BootRIT/filenOLD.LST/';
65 RUN;
 
ERROR: Resource is write-locked by another user. File =/folders/myfolders/BootRIT/filenOLD.LST. System Error Code = 11.
 
ERROR: File is in use, /folders/myfolders/BootRIT/filenOLD.LST.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
<br\> WARNING: Maximum log size exceeded. Click here to view full log.
 

Can someone tell me what I have done wrong and how to get the log to be written to a file?

Thanks

 

 


Accepted Solutions
Solution
‎01-09-2018 09:18 AM
Super User
Super User
Posts: 9,227

Re: Writing to a log file

Posted in reply to jacksonan123

Well, first off I assume this is a typo:

proc printto log='/folders/myfolders/BootRIT/filenOLD.LST/';

 

As the last / is not correct.

What is BootRIT?  Do you have write access to it, is it being used by the system?  Try a file somewhere else:

proc printto log='/folders/myfolders/filenold.log';
run;

Note the various updates I made to the code.

View solution in original post


All Replies
Solution
‎01-09-2018 09:18 AM
Super User
Super User
Posts: 9,227

Re: Writing to a log file

Posted in reply to jacksonan123

Well, first off I assume this is a typo:

proc printto log='/folders/myfolders/BootRIT/filenOLD.LST/';

 

As the last / is not correct.

What is BootRIT?  Do you have write access to it, is it being used by the system?  Try a file somewhere else:

proc printto log='/folders/myfolders/filenold.log';
run;

Note the various updates I made to the code.

Frequent Contributor
Posts: 114

Re: Writing to a log file

Your suggested code worked.  The Bootrit was a folder that I had created.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 173 views
  • 0 likes
  • 2 in conversation