<?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 use SASLOG block:column indicators to locate MACRO code errors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891353#M352135</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29730"&gt;@eshupp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Easier said than done when your error is in block 58296. If SAS knows which block the error is in I should have some way to display block numbers in the debugging output other than paging through thousands of lines of SASLOG. With open code errors the line numbers are displayed but MPRINT does not provide the same information.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah, it would be nice if you could do this, but you can't.&amp;nbsp; It's one of the limitations of the the way the macro processor was designed that a macro doesn't have line breaks in it (which is why you can't use CARDS in a macro).&amp;nbsp; So when the macro generates lines of code and sends them to SAS to be compiled and executed, my guess is it's all one line (in a sense). So the log can't tell you a useful line number for an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One workaround some folks use is to use MPRINT and MFILE to create a .sas file with no macro code, which can then be %included to generate a log with useful line numbers for errors.&amp;nbsp; See e.g.&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings14/1302-2014.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings14/1302-2014.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 16:54:25 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-08-28T16:54:25Z</dc:date>
    <item>
      <title>How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891342#M352130</link>
      <description>&lt;P&gt;Based on information I have found on other sites and a SUGI paper written by Paul Sherman it appears that ERROR messages like "NOTE: Invalid second argument to function SUBSTR at line nnnnn column nnn" are actually indicating macro BLOCK and COLUMN rather than open code LINE and COLUMN.&amp;nbsp; My question is, if I turn on MACRO options like MPRINT or MGEN or MLOGIC how can I determine the block numbers in the output.&amp;nbsp; Is there some undocumented automatic macro variable like &amp;amp;SYSMACBLOCK that I could %PUT to the log to identify more closely which of my generated statements is generating the note when I have lots of SUBSTR calls?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 15:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891342#M352130</guid>
      <dc:creator>eshupp</dc:creator>
      <dc:date>2023-08-28T15:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891345#M352131</link>
      <description>&lt;P&gt;&lt;A href="https://en.wiktionary.org/wiki/that_way_madness_lies#:~:text=From%20The%20Tragedy%20of%20King,1606)%2C%20see%20quotations." target="_self"&gt;That way madness lies&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just turn on MPRINT and check the log for your mistakes.&lt;/P&gt;
&lt;P&gt;If you are really desperate then turn on SYMBOLGEN and/or MLOGIC and slog your way through the reams of log messages.&lt;/P&gt;
&lt;P&gt;Or better still put in some PUT or %PUT statements to debug where the errors are.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 15:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891345#M352131</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-28T15:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891349#M352133</link>
      <description>Easier said than done when your error is in block 58296.  If SAS knows which block the error is in I should have some way to display block numbers in the debugging output other than paging through thousands of lines of SASLOG.  With open code errors the line numbers are displayed but MPRINT does not provide the same information.</description>
      <pubDate>Mon, 28 Aug 2023 15:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891349#M352133</guid>
      <dc:creator>eshupp</dc:creator>
      <dc:date>2023-08-28T15:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891351#M352134</link>
      <description>&lt;P&gt;With MPRINT on, the ERROR messages appear immediately below the actual error (just as they do when you are not running macro code), plus you can see the actual SAS code that you macro has created; and you don't need a line number of block number to find them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;...&amp;nbsp;&lt;SPAN&gt;other than paging through thousands of lines of SASLOG ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No need to do that. Using the search function in the LOG window (ctrl-F) will get you there quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 16:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891351#M352134</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-28T16:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891353#M352135</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29730"&gt;@eshupp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Easier said than done when your error is in block 58296. If SAS knows which block the error is in I should have some way to display block numbers in the debugging output other than paging through thousands of lines of SASLOG. With open code errors the line numbers are displayed but MPRINT does not provide the same information.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah, it would be nice if you could do this, but you can't.&amp;nbsp; It's one of the limitations of the the way the macro processor was designed that a macro doesn't have line breaks in it (which is why you can't use CARDS in a macro).&amp;nbsp; So when the macro generates lines of code and sends them to SAS to be compiled and executed, my guess is it's all one line (in a sense). So the log can't tell you a useful line number for an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One workaround some folks use is to use MPRINT and MFILE to create a .sas file with no macro code, which can then be %included to generate a log with useful line numbers for errors.&amp;nbsp; See e.g.&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings14/1302-2014.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings14/1302-2014.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 16:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891353#M352135</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-08-28T16:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891373#M352138</link>
      <description>Thanks!  That sounds like a great option.  I have never used the MFILE option before but I will give it a try!</description>
      <pubDate>Mon, 28 Aug 2023 18:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891373#M352138</guid>
      <dc:creator>eshupp</dc:creator>
      <dc:date>2023-08-28T18:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SASLOG block:column indicators to locate MACRO code errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891387#M352147</link>
      <description>Using the MPRINT and MFILE options I was able to finally identify the SUBSTR functions that were generating the NOTE statements quickly.  Thanks again!</description>
      <pubDate>Mon, 28 Aug 2023 19:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-SASLOG-block-column-indicators-to-locate-MACRO-code/m-p/891387#M352147</guid>
      <dc:creator>eshupp</dc:creator>
      <dc:date>2023-08-28T19:12:51Z</dc:date>
    </item>
  </channel>
</rss>

