<?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: Juletip #13 - A new (old) debugging tool in SAS Community Nordic</title>
    <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-13-A-new-old-debugging-tool/m-p/320238#M27</link>
    <description>&lt;P&gt;Great tip Allan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see a video of this with the DATA STEP debugger in action in SAS Enterprise Guide, you can go to &lt;A href="https://attendee.gotowebinar.com/register/684650876662908164" target="_self"&gt;this video &lt;/A&gt;and jump 54 minutes forward&amp;nbsp;into the video. Then you can see a 5 minutes demo of this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2016 14:39:35 GMT</pubDate>
    <dc:creator>GeorgMorsing</dc:creator>
    <dc:date>2016-12-20T14:39:35Z</dc:date>
    <item>
      <title>Juletip #13 - A new (old) debugging tool</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-13-A-new-old-debugging-tool/m-p/319851#M25</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To some, this Christmas tip might be old wine on new bottles, since&amp;nbsp;this feature has actually been available for quite some time, but at least wasn't known to me until very recently. The reason I became aware of this, was this&amp;nbsp;tiny new button in my Enterprise Guide window that caught my attention:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Capture.PNG" alt="Capture.PNG" src="https://communities.sas.com/t5/image/serverpage/image-id/6365i37C6BC0513B448B6/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;Thinking to myself, "what might this new button do...", I was pleasantly surprised to find out that this was a debugging tool I've known and loved from other programming tools I've used during my time at university. Starting to research further however, I quickly realized that this has actually been possible for a while, dating back at least to the old display manager days (which I know for a fact, hasn't seen any updates for quite a while).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data out / debug;
   set sashelp.class;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you've ever come across the above "debug" option before, you might already be a debug-savvy, but regardless of knowing about this or not, I encourage you to read on!&amp;nbsp;The new way of debugging&amp;nbsp;is a lot more graphical, informative&amp;nbsp;and user friendly, but with all the power of the&amp;nbsp;well-known&amp;nbsp;way.&amp;nbsp;All in all, this just might be your new favorite tool for crushing those annoying bugs we all know and experience, buried deep within your complex data steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm of course speaking of the "new" Data Step Debugger (DSD), which is now available via a graphical user interface within your Enterprise Guide. All this new tool requires is the newest version (7.13) of Enterprise Guide. Clicking the aforementioned green button will display a data-step indicator for each data step in your code.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Capture2.PNG" alt="Capture2.PNG" src="https://communities.sas.com/t5/image/serverpage/image-id/6370iE811342359A94BEC/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;Clicking on the green "bug" for the data step you wish to debug, automatically&amp;nbsp;brings the specified code into the debugger window.&amp;nbsp;This window looks very simple on the surface, but&amp;nbsp;has a few tricks up its sleeve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG title="Capture3.PNG" alt="Capture3.PNG" src="https://communities.sas.com/t5/image/serverpage/image-id/6369i04979EA96284ABBE/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;Center stage, you of course have your SAS code, which you can walk through line by line. This is primarily controlled via the buttons up top.&amp;nbsp;By placing a breakpoint on the lines of interest, you can make the execution pause in every iteration on this/these specific lines of code. This gives&amp;nbsp;you the possibility to take a look at the current values of all the variables you have defined, and even calculate other values based on what you have in your table.&amp;nbsp;This can be very helpful for figuring out what's wrong with the code!&lt;/P&gt;
&lt;P&gt;If you're less sure exactly where the bug resides, pressing F10 will be of great value to you, or simply clicking "Step execution to next line".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the right hand side, you have a complete overview of all your variables.&amp;nbsp;Even the hidden variables you never get to see (unless you ask SAS nicely), like &lt;FONT face="courier new,courier"&gt;_ERROR_&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;first.x&amp;nbsp;&lt;/FONT&gt;and &lt;FONT face="courier new,courier"&gt;end&lt;/FONT&gt;. Also, pay close attention to the "watch" tickbox, which when clicked, pauses the execution&amp;nbsp;whenever the given variable is changed. This can be handy if your variable of interest is hiding in&amp;nbsp;numerous lines of code, and you want to keep track of every change in value.&lt;/P&gt;
&lt;P&gt;Speaking of change in variables, any value changes in&amp;nbsp;the last executed line of code are indicated by red colored text for this variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the lower left corner you have the Debug Console, which allows for typing in control commands, which is where most of the aforementioned tricks are hidden. I invite you to&amp;nbsp;investigate these further on &lt;A href="http://support.sas.com/documentation/cdl/en/lebaseutilref/64791/HTML/default/viewer.htm#n1ulcr5494fc5on1gg1cdzufez76.htm" target="_blank"&gt;this&lt;/A&gt;&amp;nbsp;support site, or clicking the looped square at the very right of the command line, for a cheat sheet of available commands.&lt;/P&gt;
&lt;P&gt;For example&amp;nbsp;by writing &lt;FONT face="courier new,courier"&gt;break 7&amp;nbsp;after 5&lt;/FONT&gt;, you can stop at the 7th line after 5 iterations of the data step, among many other avialable options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A few things to note:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can only debug one data step at a time&lt;/LI&gt;
&lt;LI&gt;For various reasons, it is only possible to debug data steps. Any "proc" you might use (including SQL), is not&amp;nbsp;debug-ready.&lt;/LI&gt;
&lt;LI&gt;If your buggy datastep includes a DATALINES or a CARD statement, this needs to be put&amp;nbsp;into a separate data step. Having this as part of a data step you wish to debug is not supported.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Enjoy the debugger, and your soon-to-be bug free code, and have a very merry christmas!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 09:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-13-A-new-old-debugging-tool/m-p/319851#M25</guid>
      <dc:creator>AllanLassen</dc:creator>
      <dc:date>2016-12-19T09:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Juletip #13 - A new (old) debugging tool</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-13-A-new-old-debugging-tool/m-p/320238#M27</link>
      <description>&lt;P&gt;Great tip Allan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see a video of this with the DATA STEP debugger in action in SAS Enterprise Guide, you can go to &lt;A href="https://attendee.gotowebinar.com/register/684650876662908164" target="_self"&gt;this video &lt;/A&gt;and jump 54 minutes forward&amp;nbsp;into the video. Then you can see a 5 minutes demo of this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-13-A-new-old-debugging-tool/m-p/320238#M27</guid>
      <dc:creator>GeorgMorsing</dc:creator>
      <dc:date>2016-12-20T14:39:35Z</dc:date>
    </item>
  </channel>
</rss>

