BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I am running a program that  generates a big log while running, so I decided to use the 'PROC PRINTTO LOG.' However, at the end of the run, 

                                    I want to delete this file after checking for errors before rerunning. Unfortunately, everything is going fine, but I cannot delete the log file while the program opens in sas9.4. Is there an option I can delete even if the program is available? (it looks like I need an option like 'Libname xx clear;)

 

This is the pop message (like any other files open at some place while deleting it)

" the action cannot be completed because the file is open in sas 9.4"

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You need to close the file after you have created it. You do this via the SAS command

 

proc printto; run;

 

before you try to delete it.

 

Alternatively, don't delete it but tell PROC PRINTTO to just start a new file the next time you run the program.

 

proc printto new log= ... ;

 

 

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

You need to close the file after you have created it. You do this via the SAS command

 

proc printto; run;

 

before you try to delete it.

 

Alternatively, don't delete it but tell PROC PRINTTO to just start a new file the next time you run the program.

 

proc printto new log= ... ;

 

 

--
Paige Miller
SASuserlot
Barite | Level 11

It worked Thank you very much for your help.

Ksharp
Super User
Or try this one :

dm 'log; file "c:\temp\ReportPrint.log" replace;' ;

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1040 views
  • 1 like
  • 3 in conversation