DATA Step, Macro, Functions and more

Clearing log window from CALL ECECUTE

Reply
New Contributor
Posts: 3

Clearing log window from CALL ECECUTE

I have a macro which uses the CALL EXECUTE command to invoke macros from a DATA _NULL_ step. To the best of my understanding, prior to the actual execution of each macro invocation, the log displays the generated code based on each invoked macro. Since I have over 3000 invocations my log window fills up prior to execution. This prompts a dialog box which asks if I want to clear/file the log window. Since I have many files, each with 3000+ invocations, I would like to run this overnight without any user responses.

Two questions:
1 -- Is there a way to expand what can be stored in my log window so that the save/file request will not be issued?

2 -- Is there code that will automatically clear the log during the generation of code? I have a "dm 'log;clear;'" statement within the called macro which clears the log once execution begins, but not during the generation of code?

Thanks,
Mike


%macro run_prep_comdyn4( guild );
data _null_;
set c.&guild._final_ni_fi;
by state route year;

if first.year then do;
call execute( '%a('||guild||','||state||','||route||','||year||')' );
end;

run;
%mend run_prep_comdyn4;
Super Contributor
Posts: 474

Re: Clearing log window from CALL ECECUTE

Hi.

Have you tried to reduce the log feedback by issuing:

OPTIONS NOMPRINT NONOTES NOSGEN NOMLOGIC;

?

Not sure, if it will cover the 300 invocations though.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
New Contributor
Posts: 3

Re: Clearing log window from CALL ECECUTE

Posted in reply to DanielSantos
Daniel,

That did the trick.

Thanks,
Mike
Super Contributor
Posts: 394

Re: Clearing log window from CALL ECECUTE

Since you want to run the program overnight, have you considered running the program in "batch mode," that is, from the command line, instead of via DMS? The log and listing output will be written to files and you won't have to worry about clearing the log window.
N/A
Posts: 0

Re: Clearing log window from CALL ECECUTE

Hi,

For this you can redirect your log to external file.

Proc printto log="Give any file name with extension(.txt,.log.....)";
run;


Run this code before your macro executes.
This will create an external file and your log information will be stored in that file.
Later if you dont want this you can delete the file. Even you can keep this for furthur use.

At the end you need to run this code


Proc printto;
run;


To redirect the log from external file.

Hope this will help you.
Ask a Question
Discussion stats
  • 4 replies
  • 187 views
  • 0 likes
  • 4 in conversation