BookmarkSubscribeRSS Feed
nbirkett
Calcite | Level 5
I have a SAS programme which I have to submit to a remote site to execute. In order to preserve my log/print output, I use O/S commands to delete and create them (see below for code). This has worked fine for several months and continues to work on my test machine. But, for the past two weeks, the remote site has been unable to delete the log/print files after my programme has completed. They get an error saying that the file is still in use. They are storing the files on a network server, not a local machine.

Any advice/suggestions would be appreciated.

Nick.

options noxwait;

data _null_;
command = "rmdir /S /q &location_results";
call system (command);
command1 = "mkdir &location_results";
call system (command1);
run;


proc printto;
run;

filename outlog CLEAR;
filename outlog "&location_results\log_cohort1_mf.txt";

filename outprint CLEAR;
filename outprint "&location_results\print_cohort1_mf.txt";

proc printto new log=outlog print=outprint;
run;
2 REPLIES 2
Patrick
Opal | Level 21
Hi

I don't really understand how "filename outprint CLEAR;" would delete any listing output. Doesn't it just clear the output path for listing output without affecting listing output already created?

Another thought: Is there a reason for using "noxwait"? May be running things with options "xwait" and "synch" could resolve the issue. Just thinking that a change in the environment might have slowed down things so that you're now trying to delete stuff before it actually got released - just guessing here.

HTH
Patrick
nbirkett
Calcite | Level 5
Yes, I agree with you. The 'filename' was included just to delete the name allocated to the output. The deletion occurred in the previous code fragment.

I will look into the 'noxwait' suggestion. Thanks.

Nick.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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