DATA Step, Macro, Functions and more

How to suppress global and automatic variables from being written to log

Reply
Contributor
Posts: 55

How to suppress global and automatic variables from being written to log

I'm working with a high volume macro programming job on Solaris UNIX. I've been able to suppress unneeded items going to the log except for global and automatic macro variable definitions. I've done proc options and set every option that appears to be related to the printing of info to the log.

Any ideas how to suppress messages like the following?

GLOBAL MDATE14
GLOBAL HNAME16
GLOBAL LSDATE19
GLOBAL FILE19
GLOBAL FTYPE19
GLOBAL MDATE23
AUTOMATIC AFDSID 0
AUTOMATIC AFDSNAME
AUTOMATIC AFLIB
AUTOMATIC AFSTR1
AUTOMATIC AFSTR2
AUTOMATIC FSPBDV
AUTOMATIC SYSBUFFR
AUTOMATIC SYSCC 0
AUTOMATIC SYSCHARWIDTH 1
AUTOMATIC SYSCMD
AUTOMATIC SYSDATE 07OCT08
Super Contributor
Super Contributor
Posts: 3,174

Re: How to suppress global and automatic variables from being written to log

I suspect that your SAS program has one or more of the following commands:

%PUT _GLOBAL_;

%PUT _AUTOMATIC_;

If you set the following options, it should be pretty obvious where the code is, relative to other SAS processing:

MACRO NOSOURCE SOURCE SOURCE2 MACROGEN SYMBOLGEN MLOGIC %
OPTIONS NOSOURCE;

Using SAS old-style (SAS 79) macro statements (as opposed to the SAS macro language), the character string "NOSOURCE" will be substituted with the data that follows. So, if there is any SAS code that turns off SOURCE, you can expect it to be turned back on with maximum SASLOG diagnostics information.


Scott Barry
SBBWorks, Inc.
Contributor
Posts: 55

Re: How to suppress global and automatic variables from being written to log

The source2 option did cause a "%put _ALL_;" line to show up in an included macro subroutine that a third party wrote. This is a large macro process with dozens of macro subroutines and over 1,000 lines of code.

Am I correct to assume that "%put _ALL_;" will print automatic and global variables? The manuals I have don't mention that or the MACROGEN command. Message was edited by: JMarkW
Super Contributor
Super Contributor
Posts: 3,174

Re: How to suppress global and automatic variables from being written to log

Here's the SAS 9 Macro Language Doc reference:

http://support.sas.com/onlinedoc/913/getDoc/en/mcrolref.hlp/a000206943.htm


Run this code:

%let z = I am global;
%macro x;
%let y = I am local;
%put _all_;
%mend x;
%x;

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 3 replies
  • 196 views
  • 0 likes
  • 2 in conversation