Help using Base SAS procedures

Stop FORMAT from printing values to LOG

Reply
Occasional Contributor
Posts: 18

Stop FORMAT from printing values to LOG

Anyone know how to shut this off? I'm using a %include for a proc format statement coming from a vendor and the output is quite large as it prints the value of the entire format statement to the log. Anyway to shut this off?
Regular Contributor
Posts: 165

Re: Stop FORMAT from printing values to LOG

Posted in reply to SusieQ324
You could do

ods listing close;
%include...
ods listing;

ods exclude=ALL is another option.

*Never mind, I was thinking of the output window, not the log.

Message was edited by: RickM

Try using

proc printo log="file.log";run
%include
proc printto;run; Message was edited by: RickM
Super Contributor
Posts: 394

Re: Stop FORMAT from printing values to LOG

Try the NOSOURCE2 option.

[pre]
SOURCE2 | NOSOURCE2
specifies whether SAS writes secondary source statements from files included by %INCLUDE statements to the SAS log.
[/pre]
Occasional Contributor
Posts: 18

Re: Stop FORMAT from printing values to LOG

Thanks Tim. How is this handled if it's embedded within a Macro. Looks like when I have MPRINT turned on, it'll still print. Anyway around that as well?
Super Contributor
Super Contributor
Posts: 3,174

Re: Stop FORMAT from printing values to LOG

Posted in reply to SusieQ324
What's unclear here is whether there is a SOURCE2 coded explicitly on the %INCLUDE within your "vendor-supplied macro" - I suspect that it is?

You can use a SAS macro "statement" (old-style, some call SAS 79 style), as shown below:

MACRO SOURCE2 NOSOURCE2 %

This will cause SAS to change the code string SOURCE2 to NOSOURCE2.


Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 18

Re: Stop FORMAT from printing values to LOG

Thanks Scott. I checked the macro and it's strictly VALUE statements...no options set, so it must be a default of my system. The code you suggest didn't work for me so I'll just have to live with it in the debug process and then make sure it's turned off for other usage.

If anyone has other suggestions, I'd appreciate it.
Super Contributor
Super Contributor
Posts: 3,174

Re: Stop FORMAT from printing values to LOG

Posted in reply to SusieQ324
The code statement is the %INCLUDE, not the specific PROC FORMAT. If you have access to the actual PROC or DATA step code-piece, you can always insert this statement:

OPTIONS NOSOURCE NOSOURCE2;

More information is needed to explain the SAS programming technique used, such as whether a MACRO is defined or open SAS code? Try the OPTIONS above - you will want to verify that there is no other OPTIONS statement being invoked within the vendor code.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 6 replies
  • 151 views
  • 0 likes
  • 4 in conversation