BookmarkSubscribeRSS Feed
Obsidian | Level 7

I'm running a batch file with the following command to clean up logs and log the information to a text document on user workstations. Workstations are Windows 10, and we are running SAS Foundation 9.4m5.


"C:\Program Files\SASHome\SASFoundation\9.4\cleanwork.exe" /alllogs /verbose >>%logfile%


In my log I'm finding most of the entries say the process is not active and the file is removed, but sometimes it shows the following:


ERROR: C:\Users\user\AppData\Roaming\SAS\LOGS\sasjava.3f74.46f5e1d2.log : The process cannot access the file because it is being used by another process.

REMOVED: C:\Users\user\AppData\Roaming\SAS\LOGS\sasjava.3f74.46f5e1d2.log


I've checked and this file looks like it was not removed, is there a way I can make the process report correctly about removing or not removing a log file when it is in use? My other job for the temporary directories appears to be reporting correctly.






Quartz | Level 8

it sounds like you might be trying to write the results of cleanwork out to a log file, but that cleanwork is in fact trying to remove that same log file ? 

Obsidian | Level 7

Hi Thanks for the response @34reqrwe. My log file does not have 'java' in the name. My question is just about the fact that it reports a log file is in use, and then it reports that the log file has been removed.

I'd rather it not say that it is removed when it is not - it will cause confusion for my users. I spot checked a couple files and they were not removed as reported.



Quartz | Level 8

Have you checked when the file was created? . It is possible that the file is being removed , and then recreated with the same name.

Obsidian | Level 7
Yes, and I just double-checked another. File was last created 12/11/2018 12:56 PM, and the cleanwork job ran at 12/12/2018 6:00:01.62, when it says it removed the log. Other logs are getting removed, so it is working as designed. It is just reporting incorrectly.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2 in conversation