<?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: Debug sas code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807561#M318413</link>
    <description>Your question is vague and I am not sure what kind of answer you are expecting.&lt;BR /&gt;&lt;BR /&gt;You can debug data steps with the /debug option.&lt;BR /&gt;For overall debugging, you may need to study the testing methodology.&lt;BR /&gt;&lt;BR /&gt;As already mentioned, if the time consumed per step is too much, consider improving the processing method.&lt;BR /&gt;However, over-optimization, such as macros, multiple nesting, complex queries, etc., may reduce readability, so over-optimization should be avoided.&lt;BR /&gt;</description>
    <pubDate>Wed, 13 Apr 2022 07:27:21 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-04-13T07:27:21Z</dc:date>
    <item>
      <title>Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807552#M318408</link>
      <description>How to debug the code before send to user &lt;BR /&gt;and how to optimize sas code typically &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Apr 2022 06:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807552#M318408</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2022-04-13T06:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807555#M318411</link>
      <description>&lt;P&gt;Maxim 2: Read the Log.&lt;/P&gt;
&lt;P&gt;Fix all ERRORs, WARNINGs and NOTEs beyond those that inform about CPU usage and results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Google will lead you to lots of resources/documentation/papers dealing with code optimization. Learning to optimize code is an ongoing process that never ends (also called "experience"); one can literally write&amp;nbsp;&lt;EM&gt;books&lt;/EM&gt; about the subject so don't expect an exhaustive answer here.&lt;/P&gt;
&lt;P&gt;Start by identifying long-running or resource-consuming steps, and see if you can find better methods.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 06:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807555#M318411</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-13T06:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807561#M318413</link>
      <description>Your question is vague and I am not sure what kind of answer you are expecting.&lt;BR /&gt;&lt;BR /&gt;You can debug data steps with the /debug option.&lt;BR /&gt;For overall debugging, you may need to study the testing methodology.&lt;BR /&gt;&lt;BR /&gt;As already mentioned, if the time consumed per step is too much, consider improving the processing method.&lt;BR /&gt;However, over-optimization, such as macros, multiple nesting, complex queries, etc., may reduce readability, so over-optimization should be avoided.&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Apr 2022 07:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807561#M318413</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-04-13T07:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807601#M318431</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;How to debug the code before send to user &lt;BR /&gt;and how to optimize sas code typically &lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Optimize what? Amount of code (shorter program text)? Shorter run time? Less memory usage? Amount of network traffic? Disk input/output operations? Code maintenance/flexibility? Time to write program?&lt;/P&gt;
&lt;P&gt;And likely a few other things that might be optimized are possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many of these involve tradeoffs. To minimize "in memory use" you may have to use much more disk input/output. Or the reverse. Short code can lead to extremely terse statements that are hard to follow and maintain. Writing very flexible program code may require much more coding time to debug and test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Outside of nearly trivial classroom exercises "optimize" requires a lot of specifications as to what the goal of you optimize and what the measure(s) of success might be.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 14:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807601#M318431</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-13T14:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807609#M318433</link>
      <description>How to optimize sas code?&lt;BR /&gt;Simple anwser  expected  interviwer</description>
      <pubDate>Wed, 13 Apr 2022 14:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807609#M318433</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2022-04-13T14:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807611#M318435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;How to optimize sas code?&lt;BR /&gt;Simple anwser expected interviwer&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Congratulations! You found a total idiot trying to disguise as an interviewer.&lt;/P&gt;
&lt;P&gt;There is no simple answer, period. Anybody with an IQ above room temperature (measured in Centigrade) knows this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I wanted to test someone, I'd hand them an older version of a recently improved code and then looked at the suggestions &lt;EM&gt;they&lt;/EM&gt; come up with.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 14:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807611#M318435</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-13T14:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807615#M318438</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;How to optimize sas code?&lt;BR /&gt;Simple anwser expected interviwer&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Pretty much my previous comments on Optimize what? would be my response to an interviewer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not be afraid to ask an interviewer to expand on their questions. The question may be exactly what they want/expect to see if you are aware that the subject of a question is complex. They may even have a script they are following that would have a follow up sucha: "For example, what steps might you take to minimize program run time?". (Which could go into an extensive back-and-forth about the run time environment, tasks, connections to external data bases and other things that come to mind.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A good interviewer for hiring should expect a knowledgeable candidate to ask for clarification on ambiguous questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or when in doubt answer "42".&lt;/P&gt;
&lt;P&gt;If you don't recognize the reference look up "Hitchhikers Guide to the Galaxy" and related works. In fact the second response to a web search I just ran for "42" returns: &lt;A href="https://www.dictionary.com/e/slang/42/" target="_blank"&gt;https://www.dictionary.com/e/slang/42/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 15:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807615#M318438</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-13T15:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807620#M318441</link>
      <description>&lt;P&gt;Also see Maxim 42. It also applies to interview questions.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 15:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/807620#M318441</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-13T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Debug sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/808204#M318670</link>
      <description>&lt;P&gt;If you want robust code, I suggest to switch on STRICT mode - ie, to invoke this macro at the start of all your jobs;&amp;nbsp;&amp;nbsp;&lt;A href="https://core.sasjs.io/mp__init_8sas.html" target="_blank"&gt;https://core.sasjs.io/mp__init_8sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you want to catch common programming issues before they make it to your GIT repo, you can also try the SASjs lint:&amp;nbsp; &lt;A href="https://github.com/sasjs/lint" target="_blank"&gt;https://github.com/sasjs/lint&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Finally, if you want some structure and consistency in the development of your SAS Solution, you could consider scaffolding your project with SASjs.&amp;nbsp; See:&amp;nbsp;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/Scaffolding-SAS-Projects-With-NPM-and-SASjs/ta-p/726347" target="_blank"&gt;https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/Scaffolding-SAS-Projects-With-NPM-and-SASjs/ta-p/726347&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Disclaimer - my team built the SASjs framework.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Apr 2022 21:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Debug-sas-code/m-p/808204#M318670</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-04-16T21:52:49Z</dc:date>
    </item>
  </channel>
</rss>

