<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/336219#M272361</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;If mprint is turned on when the %test macro is called, there are a couple of lines generated in the log prior to the %PUT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;220&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %test;&lt;BR /&gt;MPRINT(TEST):&amp;nbsp;&amp;nbsp; options nonotes;&lt;BR /&gt;MPRINT(TEST):&amp;nbsp;&amp;nbsp; options nomprint;&lt;BR /&gt;MPRINT(TEST):&amp;nbsp; ;&lt;BR /&gt;Max Age -&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2017 14:53:49 GMT</pubDate>
    <dc:creator>ShaneRosanbalm</dc:creator>
    <dc:date>2017-02-27T14:53:49Z</dc:date>
    <item>
      <title>How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335724#M272354</link>
      <description>&lt;P&gt;Is there a way to set NOMPRINT from within a macro &lt;STRONG&gt;&lt;EM&gt;without having the OPTIONS statement show up in the log&lt;/EM&gt;&lt;/STRONG&gt;? The macro in question (let's call it %RESULT) will use DATA, PROC, and macro steps to derive the value of a macro variable. At the very end the macro will report the result to the log with a %PUT statement. Ideally the macro would add nothing to the log prior to the %PUT statement at the end. Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*--- macro in concept ---;&lt;/P&gt;&lt;P&gt;%macro result(data=);&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA...&lt;/P&gt;&lt;P&gt;&amp;nbsp; PROC...&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if...&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put &amp;amp;=result;&lt;/P&gt;&lt;P&gt;%mend result;&lt;/P&gt;&lt;P&gt;%result(data=cars)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*--- desired log lines ---;&lt;/P&gt;&lt;P&gt;%result(data=cars)&lt;/P&gt;&lt;P&gt;RESULT=428&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: this is a utility macro, so I will have no control over whether MPRINT is on/off when the macro is called.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335724#M272354</guid>
      <dc:creator>ShaneRosanbalm</dc:creator>
      <dc:date>2017-02-24T19:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335743#M272355</link>
      <description>&lt;P&gt;1. Use PROC OPTIONS to determine the value of the option MPRINT in the beginning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Use Options NONOTES to suppress the notes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quick sketch to show how that works.&lt;/P&gt;
&lt;P&gt;Just note that the options word will show up in the macro execution so if that's not allowed not sure how you'd do it. Maybe proc options as well? I'm not even sure if you can set options from that proc &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 21:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335743#M272355</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-24T21:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335748#M272356</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;Thanks for the suggestion, but I don't think that works. I don't want anything in my log between the %RESULT call and the %PUT of the results. I think using PROC OPTIONS would give me the same problem as OPTIONS NOMPRINT (namely, the PROC statement would show up in the log). Similarly with OPTIONS NONOTES; if I put this in the macro, I will see OPTIONS NONOTES in my log before I see the %PUT results. My goal is to get MPRINT (and NOTES) turned off without any evidence of a statement having been executed. Perhaps I ask the impossible. Though I hope not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking time to make the suggestion.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 21:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335748#M272356</guid>
      <dc:creator>ShaneRosanbalm</dc:creator>
      <dc:date>2017-02-24T21:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335749#M272357</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;You can get the current value of course from:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mprint = %sysfunc(getoption(mprint));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27552"&gt;@ShaneRosanbalm&lt;/a&gt;&amp;nbsp;If you don't the option text to appear from the execution of the macro, set the option within&amp;nbsp;&lt;EM&gt;autoexec&lt;/EM&gt;. Otherwise, if&amp;nbsp;&lt;EM&gt;mprint&lt;/EM&gt; is already set on, turning it off within the macro will always appear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get really geeky, though, you can redirect the log output to a work library catalogue entry, then throw it away. But you'll still get at least a hint somewhere that you've done this.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 21:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335749#M272357</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-02-24T21:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335750#M272358</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27552"&gt;@ShaneRosanbalm&lt;/a&gt;&amp;nbsp;Then&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;&amp;nbsp;solution to use the function GETOPTION will work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As long as the requirements are what you stated, this appears to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; I don't want anything in my log between the %RESULT call and the %PUT of the results.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro test;

%let op_mprint = %sysfunc(getoption(mprint));
%let op_notes = %sysfunc(getoption(notes));

options nonotes;
options nomprint;

proc sql noprint;
select max(age) into: max_age from sashelp.class;
quit;



options &amp;amp;op_mprint &amp;amp;op_notes;
%put Max Age -&amp;gt; &amp;amp;max_age;
%mend;

%test;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 21:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335750#M272358</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-24T21:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335783#M272359</link>
      <description>That's exactly the technique I use in my toolkit macros. I often do the reverse as well: a debug option for setting all the mlogicing and symbolgening on, then turning them off at the end. &lt;BR /&gt;</description>
      <pubDate>Fri, 24 Feb 2017 22:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335783#M272359</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-02-24T22:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335784#M272360</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27552"&gt;@ShaneRosanbalm&lt;/a&gt;&amp;nbsp;if you're developing macros, one solution that I don't like, is you can look at the STORED and SECURE option to suppress the code from the user.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.amadeus.co.uk/sas-training/tips/5/1/63/how-to-keep-secret-code-secret.php" target="_blank"&gt;http://www.amadeus.co.uk/sas-training/tips/5/1/63/how-to-keep-secret-code-secret.php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 22:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/335784#M272360</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-24T22:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/336219#M272361</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;If mprint is turned on when the %test macro is called, there are a couple of lines generated in the log prior to the %PUT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;220&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %test;&lt;BR /&gt;MPRINT(TEST):&amp;nbsp;&amp;nbsp; options nonotes;&lt;BR /&gt;MPRINT(TEST):&amp;nbsp;&amp;nbsp; options nomprint;&lt;BR /&gt;MPRINT(TEST):&amp;nbsp; ;&lt;BR /&gt;Max Age -&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/336219#M272361</guid>
      <dc:creator>ShaneRosanbalm</dc:creator>
      <dc:date>2017-02-27T14:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to set NOMPRINT without seeing corresponding OPTIONS statement in log?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/336233#M272362</link>
      <description>&lt;P&gt;Using STORE and SECURE appears to be the only way to keep the log 100% clear of any output between the macro call (%test) and the desired result (%put). Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17429"&gt;@LaurieF&lt;/a&gt;&amp;nbsp; for their suggestions.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 15:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-NOMPRINT-without-seeing-corresponding-OPTIONS/m-p/336233#M272362</guid>
      <dc:creator>ShaneRosanbalm</dc:creator>
      <dc:date>2017-02-27T15:22:41Z</dc:date>
    </item>
  </channel>
</rss>

