Help using Base SAS procedures

How to delete the log file in batch mode

Reply
Occasional Contributor
Posts: 17

How to delete the log file in batch mode

Hello,

I am using a macro that generate a huge Log file when excuting on batch mode.

I want to delete the log file.

any help?

Thanks
Trusted Advisor
Posts: 2,115

Re: How to delete the log file in batch mode

If you don't need it at all, you can use PROC PRINTTO to direct it to the bit bucket.
Super Contributor
Super Contributor
Posts: 3,174

Re: How to delete the log file in batch mode

Tell us more about your SAS operating environment (OS, whether SAS is installed locally or on a remote server), and your SAS version as well. And, the recommendation by Doc@Duke is a good one, possibly even providing control to only delete the SAS-generated log file when a good completion occurs, as you choose to determine.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 17

Re: How to delete the log file in batch mode

Hello,
thank you for your responses!


SAS 9.1.3 is installed on a remote server. I opearte the program and after I gather the results via filezilla.

in my program I specified this command :
proc printto log='..../myprogram.log' new; run;


but the log file exists again!

what does mean bitbucket? how can I specify a null route when excecuting on a remote server?
Respected Advisor
Posts: 3,799

Re: How to delete the log file in batch mode

filename dummy dummy;
proc printto log=dummy;
run;

[pre]
device-type
specifies the type of device or the access method that is used if the fileref points to an input or output device or location that is not a physical file:

DUMMY specifies that the output to the file is discarded.

Tip: Specifying DUMMY can be useful for testing.

[/pre]
Super Contributor
Super Contributor
Posts: 3,174

Re: How to delete the log file in batch mode

Consider that you may want to review the SAS log output, so it is possible to generate the SAS log to a file (with PRINTTO), and then if your processing is satisfactory to your liking, then run a post-processing DATA step to delete the file you are using to capture the SAS log, rather than just writing it to a dummy destination. Explore using a SAS DATA step with CALL functions FILEEXIST, FILENAME, and FDELETE, in order to accomplish the special-handling of your generated log file.

The link below is associated with the SAS companion for Windows platform documentation - other similar guides are provided for your operating environment.

Scott Barry
SBBWorks, Inc.

SAS Functions and CALL Routines under Windows
http://support.sas.com/documentation/cdl/en/hostwin/61924/HTML/default/function.htm
Ask a Question
Discussion stats
  • 5 replies
  • 693 views
  • 0 likes
  • 4 in conversation