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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 450 views
  • 1 like
  • 3 in conversation