<?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: verbose logging when called via call execute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915340#M360660</link>
    <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; Here's a bit of the log:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;NOTE: 201 Created
NOTE: PROCEDURE HTTP used (Total process time):
      real time           1.81 seconds
      cpu time            0.01 seconds


11        + %consent_post2
12       
+(token=2048charactertoken,
consUrl="https://someurl" ,
20        + jsonBody='{"definition": "stuff","isGranted": true}');

NOTE: 201 Created
NOTE: PROCEDURE HTTP used (Total process time):
      real time           1.43 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can see, one variable is 8 lines long, and probably should never be logged (JWT token).&amp;nbsp; Fine with printing the 201's to the log, and even the name of the macro, but posting the parameter values is what I'm trying to get away from.&amp;nbsp; I'll keep tinkering as I'm hearing what you're saying in that the cal execute working as it's supposed to.&amp;nbsp; &amp;nbsp;I know I've solved this once, so I'll post back if I figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 19:34:54 GMT</pubDate>
    <dc:creator>noffer</dc:creator>
    <dc:date>2024-02-09T19:34:54Z</dc:date>
    <item>
      <title>verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915287#M360646</link>
      <description>&lt;P&gt;I have 2 calls to macros that call out to a proc http&lt;/P&gt;&lt;P&gt;Call 1 (called once):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt; %sbscrbr_get_jwt_token(&amp;amp;svcurl.,&amp;amp;svcuser.,&amp;amp;svcpwd.);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; ... works fine, no excessive logging&lt;/P&gt;&lt;P&gt;Call 2 (called many times in worker processes):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt; data work_dir.thread_part&amp;amp;threadId.;
&amp;nbsp; &amp;nbsp;/* do stuff */

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/**** INSERT NORMAL DATA STEP CODE HERE ****/
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;call execute('%nrstr(%consent_post2(token='||strip(token)||', consUrl='||strip(cons_url)||' , jsonBody='||strip(json_body)||'));');
&amp;nbsp; &amp;nbsp;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... which results in filling the logs with all sorts of detail about the parameters.&amp;nbsp; &amp;nbsp;I recall there was an options setting that can supress this.&amp;nbsp; I know that I did it once before, but maybe someone recalls what to set to suppress these messages?&amp;nbsp; Its helpful for debugging, but when running `10-100k posts, I think the program spends more time spitting things out to the logs than it does processing data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915287#M360646</guid>
      <dc:creator>noffer</dc:creator>
      <dc:date>2024-02-09T16:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc http verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915300#M360647</link>
      <description>&lt;P&gt;Set DEBUG LEVEL=0. See&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/proc/n0i2ek87s12e7mn1h2q3h0mywkl1.htm" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/default/proc/n0i2ek87s12e7mn1h2q3h0mywkl1.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 15:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915300#M360647</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-02-09T15:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915302#M360648</link>
      <description>&lt;P&gt;Messages aren't coming from the proc http, its just dumping the params passed into the macro.&amp;nbsp; That was my first pass.&amp;nbsp; Sorry, I should have noted.&amp;nbsp; I updated the subject as the actual "proc http" not really logging anything else other than the response code, which is fine&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915302#M360648</guid>
      <dc:creator>noffer</dc:creator>
      <dc:date>2024-02-09T16:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915312#M360651</link>
      <description>&lt;P&gt;I'm lost.&amp;nbsp; CALL EXECUTE doesn't have anything special to do with logging, or verbosity of logging.&amp;nbsp; Its job is to generate code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, it should generate one macro call for each iteration of the DATA step, so you should see lines that say CALL EXECUTE generated the line:&lt;/P&gt;
&lt;PRE&gt;%consent_post2(token=..,consUrl=...,jsonBody=...)&lt;/PRE&gt;
&lt;P&gt;Is that what you want to avoid?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are ways to turn off writing messages to the log.&amp;nbsp; For example you can use PROC PRINTTO to send the log to a file, or maybe even to nul.&amp;nbsp; &amp;nbsp;But generally IMHO turning off logging is a bad idea.&amp;nbsp; Cuz even if you believe your code is working, you can't know without seeing the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you could post a log snippet of the messages you're trying to avoid?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's also possible that there is something in the macro definition that is flooding your log.&amp;nbsp; If you just call&amp;nbsp;%consent_post2(token=..,consUrl=...,jsonBody=...) once, without using CALL EXECUTE, does that flood your log?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 17:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915312#M360651</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-02-09T17:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915340#M360660</link>
      <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; Here's a bit of the log:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;NOTE: 201 Created
NOTE: PROCEDURE HTTP used (Total process time):
      real time           1.81 seconds
      cpu time            0.01 seconds


11        + %consent_post2
12       
+(token=2048charactertoken,
consUrl="https://someurl" ,
20        + jsonBody='{"definition": "stuff","isGranted": true}');

NOTE: 201 Created
NOTE: PROCEDURE HTTP used (Total process time):
      real time           1.43 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can see, one variable is 8 lines long, and probably should never be logged (JWT token).&amp;nbsp; Fine with printing the 201's to the log, and even the name of the macro, but posting the parameter values is what I'm trying to get away from.&amp;nbsp; I'll keep tinkering as I'm hearing what you're saying in that the cal execute working as it's supposed to.&amp;nbsp; &amp;nbsp;I know I've solved this once, so I'll post back if I figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 19:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915340#M360660</guid>
      <dc:creator>noffer</dc:creator>
      <dc:date>2024-02-09T19:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915345#M360662</link>
      <description>&lt;P&gt;So I THINK what you are saying is that you are pushing a really long string to CALL EXECUTE() and you don't want to see it all echoed back in the line with the + at the front that CALL EXECUTE() generates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way to avoid that is to put the long string into a macro variable and then pass the reference to the macro variable to CALL EXECUTE() but wrap it in %NRSTR() so only the reference is shown, not the value.&amp;nbsp; (Or course that kind of defeats the purpose of having a LOG in the first place.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note you will need to make a different macro variable for each observation since the lines pushed to CALL EXECUTE() do not run until after the step that pushed them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    data _null_;
2      set sashelp.class(obs=3);
3      call execute(catx(' ','%nrstr(%put',name,');'));
4    run;

NOTE: There were 3 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


NOTE: CALL EXECUTE generated line.
1   + %put Alfred ;
Alfred
2   + %put Alice ;
Alice
3   + %put Barbara ;
Barbara
5
6    data _null_;
7      set sashelp.class(obs=3);
8      call symputx(cats('n',_n_),name);
9      call execute(cats('%nrstr(%put &amp;amp;n',_n_,');'));
10   run;

NOTE: There were 3 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


NOTE: CALL EXECUTE generated line.
1   + %put &amp;amp;n1;
Alfred
2   + %put &amp;amp;n2;
Alice
3   + %put &amp;amp;n3;
Barbara
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Feb 2024 20:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915345#M360662</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-09T20:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915347#M360664</link>
      <description>&lt;P&gt;There are systems options that will turn off writing to the log, e.g. options NOSOURCE NONOTES;&amp;nbsp; or as I mentioned even more drastic using PROC PRINTTO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is one way that some people solve this problem. Personally, these methods scare me, because the log file is a critical artifact from the SAS run.&amp;nbsp; I'd be shocked if writing the log lines for 1,000 PROC HTTP calls was slowing things down more than the 1,000 PROC HTTP calls.&amp;nbsp; &amp;nbsp;And if you're batch submitting a program, than all those log lines are being written to disk pretty quickly.&amp;nbsp; I guess with some IDE's its possible for the log to 'fill up' or be slow transferring from server to your client.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But even in those settings, I 've never chosen to turn off my log.&amp;nbsp; Even when I have "production code" that I "know works."&amp;nbsp; I don't even like it when EG or another SAS IDE turns off the log temporarily in the wrapper code it generates.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 20:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915347#M360664</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-02-09T20:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: verbose logging when called via call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915348#M360665</link>
      <description>&lt;P&gt;Thanks for your thoughtful reply, and of course I just&amp;nbsp;found where I'd done it before:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options nosource;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... just before my data step and I still get the Notes printed from the macro execution.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 21:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verbose-logging-when-called-via-call-execute/m-p/915348#M360665</guid>
      <dc:creator>noffer</dc:creator>
      <dc:date>2024-02-09T21:11:48Z</dc:date>
    </item>
  </channel>
</rss>

