BookmarkSubscribeRSS Feed
mknowles
Calcite | Level 5
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;
4 REPLIES 4
DanielSantos
Barite | Level 11
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
mknowles
Calcite | Level 5
Daniel,

That did the trick.

Thanks,
Mike
Tim_SAS
Barite | Level 11
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.
deleted_user
Not applicable
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.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 4 replies
  • 1161 views
  • 0 likes
  • 4 in conversation