<?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: urgent help for if then else debugging in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425634#M104849</link>
    <description>&lt;P&gt;A public forum is not the place to call for emergencies.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jan 2018 22:59:02 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-01-07T22:59:02Z</dc:date>
    <item>
      <title>urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425630#M104847</link>
      <description>&lt;P&gt;I have a very long code which has nested if then else... I want to know what is the best way to code and debug. I am unable to solve the error. the error I am getting is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MPRINT(TREERULE):&amp;nbsp;&amp;nbsp; END;&lt;BR /&gt;NOTE: Line generated by the invoked macro "TREERULE".&lt;BR /&gt;221&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Treatment = '???';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;BR /&gt;221 !&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 160&lt;BR /&gt;ERROR 160-185: No matching IF-THEN clause.&lt;BR /&gt;&lt;BR /&gt;MPRINT(TREERULE):&amp;nbsp;&amp;nbsp; ELSE DO;&lt;BR /&gt;MPRINT(TREERULE):&amp;nbsp;&amp;nbsp; NODENUMBER = 22;&lt;BR /&gt;MPRINT(TREERULE):&amp;nbsp;&amp;nbsp; Treatment = '';&lt;BR /&gt;MPRINT(TREERULE):&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i go through the code I cant find any missing if then clause&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 21:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425630#M104847</guid>
      <dc:creator>anonymous11</dc:creator>
      <dc:date>2018-01-07T21:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425631#M104848</link>
      <description>&lt;P&gt;Make the code run outside of a macro before attempting to make it dynamic..&lt;/P&gt;
&lt;P&gt;Hint: posting the&amp;nbsp;&lt;EM&gt;complete&lt;/EM&gt; log of a failed step might be really helpful when asking for help. Right now we can only fish in the dark.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 22:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425631#M104848</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-07T22:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425634#M104849</link>
      <description>&lt;P&gt;A public forum is not the place to call for emergencies.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 22:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425634#M104849</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-01-07T22:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425645#M104851</link>
      <description>&lt;P&gt;Debugging long macro's is definitely a pain.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you've turned on the correct options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen mlogic;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This assumes that the macro was running correctly at some point and is no longer running, or are you trying to develop a macro that isn't running?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best way to search otherwise is what is known as a modified binary search approach. Start at the top and reduce the code to one step at a time. Add back steps in chunks until you get an error and then you can look at that specific chunk.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need further help you'll at minimum need to post your code and the full log. Ideally, you'll have isolated the code causing issues using the approach above first, but if not, the whole program and log will be required.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. You really shouldn't tag questions as urgent. &amp;nbsp;SAS Support is available if you have a paid license or you should have a SAS consultant&amp;nbsp;on call. We're happy to help but your urgency doesn't equal our urgency, we're volunteers, with our own work and lives. And it isn't fair to others who have take the time to plan their work to have their questions pushed down because of a possible 'urgent' request. Basically, it comes off as really rude and inconsiderate and you're overall less likely to get answers. Oh...and if it's truly urgent and you don't respond to questions promptly then it's clearly not really urgent at all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 00:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425645#M104851</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-08T00:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425663#M104854</link>
      <description>&lt;P&gt;Thank you Kurt for the reply. I will try running it without the macro. Since I did not have the time, I actually rewrote the whole code, cut it really short to make it work. But I would like to know how to actually debug since this was just a fix. I am not sure if&amp;nbsp;i can share the code thats why i cut the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 01:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425663#M104854</guid>
      <dc:creator>anonymous11</dc:creator>
      <dc:date>2018-01-08T01:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425664#M104855</link>
      <description>Hi Reeza&lt;BR /&gt;Thanks for your reply. The macro had never run before. It was a 500 line code. it would be hard for anyone to go through it and I wasnt sure if I could post the code thats why I asked for some direction.&lt;BR /&gt;Apologies if you felt I was rude and I really appreciate you replying on the weekend. yes it was urgent and that's why I just recoded the whole thing. Not sure how will it push down others questions but that was the only way o convey my sense of urgency. again no intention if being inconsiderate.&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 08 Jan 2018 01:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425664#M104855</guid>
      <dc:creator>anonymous11</dc:creator>
      <dc:date>2018-01-08T01:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425665#M104856</link>
      <description>&lt;P&gt;Aside from others being upset that you used the word "urgent" in your title, you haven't provide enough info for anyone to help. Post at least 10 lines of code that appear above and below the error (from your log). What you posted doesn't give anyone a clue as to what might have happened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 01:48:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425665#M104856</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-01-08T01:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425696#M104859</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185337"&gt;@anonymous11&lt;/a&gt; wrote:&lt;BR /&gt;Hi Reeza&lt;BR /&gt;... The macro had never run before.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And then it's &lt;EM&gt;urgent&lt;/EM&gt;? Development takes time, looks like someone needs to have that drummed into their head.&lt;/P&gt;
&lt;P&gt;Maxim 34: Work in steps. Expecting 500 lines of code to work right from the start is, ahem, not intelligent, and that's &lt;STRONG&gt;&lt;EM&gt;very&lt;/EM&gt;&lt;/STRONG&gt; polite.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 08:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425696#M104859</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-08T08:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: urgent help for if then else debugging</title>
      <link>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425803#M104894</link>
      <description>&lt;P&gt;1) Post code and log messages into a code box using the forum {I} menu icon. The underscore character usually appears where SAS flags the error (though sometimes the error may related to something above not ended correctly such as parentheses, quotes or missing ; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your posted line (edited to be readable by removing multiple space characters"&lt;/P&gt;
&lt;PRE&gt;221   Treatment = '???';   END;   END;&lt;/PRE&gt;
&lt;P&gt;the second end may have closed the "if then" that you Else is expecting to have open. But we can't be certain as the complete log wasn't posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your 500 lines of macro code do not include a lot of comments you might want to consider breaking it up into smaller pieces. Typically a macro that combines data manipulation and output, such as tables or charts, is a candidate to resolve the manipulation into one macro and the tables and/or graphs into different macros.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 16:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/urgent-help-for-if-then-else-debugging/m-p/425803#M104894</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-08T16:16:25Z</dc:date>
    </item>
  </channel>
</rss>

