<?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 debug SAS macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174798#M44883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always display the value of a macro variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put COUNT is &amp;amp;count..;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, it's just as easy to see the values of all user-defined macro variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put _user_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's also easy to add an easy-to-locate diagnostic, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put *** HERE IT IS !!! ***;&lt;/P&gt;&lt;P&gt;%put COUNT is &amp;amp;count..;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it's also easy to just halt the program after the %PUT statements by adding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endsas;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just note that ENDSAS will stop your entire SAS session, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(a) Don't use it when using SAS interactively, and&lt;/P&gt;&lt;P&gt;(b) Don't expect to resume the program afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Dec 2013 19:29:04 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2013-12-16T19:29:04Z</dc:date>
    <item>
      <title>how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174794#M44879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a very long SAS macro (thousands of lines)to debug. For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;%let count =&amp;amp;sqlobs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to pause the program while it was running and see what is the value of count; I know&amp;nbsp; in other computer language there is usually such a debug facility to do this. Is there a similar tool in SAS? Or do I have to scroll down the log file (which could be tens of thousands of lines) to search for the value? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 16:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174794#M44879</guid>
      <dc:creator>abcd123</dc:creator>
      <dc:date>2013-12-16T16:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174795#M44880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you use the SAS Windowing environment, you can use the DATA Step debugger to debug a DATA step program. However, there is no equivalent for a SAS Macro program. Generally, the way to NOT have to debug a macro program is to start with an error-free SAS program that does what you want to do, produces the output you want and then you "macro-ize" that program. But, some statements, such as the %LET statement get resolved at code compile time, versus code execution time, so that is one challenge, I often use a lot of %PUT statements to help figure out what's going on. Also using the MPRINT MLOGIC and SYMBOLGEN options are a great help in debugging and showing you how macro variables have resolved. There have been quite a few user group papers written about how to write a program to read the log file to summarize errors, warnings, etc, however, that is not an interactive debugging technique and doesn't have much over just using the editor's search functionality (for me).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 16:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174795#M44880</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-12-16T16:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174796#M44881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. so, there is no way to pause a macro, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 17:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174796#M44881</guid>
      <dc:creator>abcd123</dc:creator>
      <dc:date>2013-12-16T17:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174797#M44882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use %WINDOW/%DISPLAY to pop-up a window.&amp;nbsp; This will let you do some things while it waits for you to respond the the displayed windows. but y&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ou will be very limited in what you can do while this window is running&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you would need to write that into the macro, the same as any other debugging code that you want to insert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 17:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174797#M44882</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-12-16T17:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174798#M44883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always display the value of a macro variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put COUNT is &amp;amp;count..;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, it's just as easy to see the values of all user-defined macro variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put _user_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's also easy to add an easy-to-locate diagnostic, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put *** HERE IT IS !!! ***;&lt;/P&gt;&lt;P&gt;%put COUNT is &amp;amp;count..;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it's also easy to just halt the program after the %PUT statements by adding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endsas;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just note that ENDSAS will stop your entire SAS session, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(a) Don't use it when using SAS interactively, and&lt;/P&gt;&lt;P&gt;(b) Don't expect to resume the program afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 19:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174798#M44883</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-12-16T19:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174799#M44884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 19:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174799#M44884</guid>
      <dc:creator>abcd123</dc:creator>
      <dc:date>2013-12-16T19:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174800#M44885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is of any help, I have used the SAS data step debugger on data step code generated by macros as described in the last section of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000379339.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000379339.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you need an introduction to the data step debugger then see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000510023.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000510023.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 12:19:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174800#M44885</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-12-17T12:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to debug SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174801#M44886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you may try options nonotes nosource2;&amp;nbsp; to suppress annoying information&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 22:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-debug-SAS-macro/m-p/174801#M44886</guid>
      <dc:creator>ping</dc:creator>
      <dc:date>2013-12-18T22:37:20Z</dc:date>
    </item>
  </channel>
</rss>

