<?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: A message to indicate where an error occurs? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635722#M188805</link>
    <description>&lt;P&gt;But this is only because you didn't set the SOURCE2 option. You can to it with an OPTIONS statement if you don't want to add it to every individual %INCLUDE statement.&amp;nbsp; You can also set the NOSOURCE option and have the code from the main program not displayed in the log.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2020 04:02:10 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-03-30T04:02:10Z</dc:date>
    <item>
      <title>A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635686#M188780</link>
      <description>&lt;P&gt;I use %rq to stop SAS from running continuously when an error occurs. My master code file includes a couple of %include statements, which means that several SAS code files are involved in one-go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro rq;
	; run; quit;
	%if &amp;amp;syserr. &amp;gt; 4 %then %do;
	%put "syserr= " &amp;amp;syserr.;
	 %abort cancel;
	%end;
	%mend rq;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I encountered two annoying issues.&lt;/P&gt;
&lt;P&gt;1) When an error occurs (and SAS stops), I don't know in which SAS code file the program stopped. Can I add a couple of lines to let me know the file where the program encountered the error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Even when I know the code where the error happened, I need to look through the code file to get to the exact place of the error code. Is there any tip that can make this process easier?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 20:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635686#M188780</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-03-29T20:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635688#M188781</link>
      <description>&lt;P&gt;When encountering a problem, I simply scan the log file for the word ERROR. That lets me locate the cause rather quickly.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 20:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635688#M188781</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-29T20:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635689#M188782</link>
      <description>&lt;P&gt;Make sure to use SOURCE2 option. Either set it globally or use on the individual %INCLUDE statement.&lt;/P&gt;
&lt;PRE&gt;639  %include text / source2;
NOTE: %INCLUDE (level 1) file TEXT is file /Volumes/scratch/SAS_work175900044221/#LN00111.
640 +* inside text file;
NOTE: %INCLUDE (level 1) ending.&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Mar 2020 20:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635689#M188782</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-29T20:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635714#M188801</link>
      <description>&lt;P&gt;Devilishly clever!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 02:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635714#M188801</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-03-30T02:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635715#M188802</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;that doesn't apply here because when you use %INCLUDE() the code doesn't go to the log, so even if you get an ERROR message it's useless at that point.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 02:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635715#M188802</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-30T02:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635716#M188803</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;that doesn't apply here because when you use %INCLUDE() the code doesn't go to the log, so even if you get an ERROR message it's useless at that point.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is not true.&amp;nbsp; It only doesn't show the code in the log if you tell it not to display the code in the log.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 02:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635716#M188803</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-30T02:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635717#M188804</link>
      <description>&lt;P&gt;No code in the log is the default behaviour of %INCLUDE. There's none of the code included in the log which would indicate where it actually happened. And no, saying the error is in the %INCLUDE statement is not enough to answer the OP's question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         %include '/home/fkhurshed/Demo1/error_test.sas';
 ERROR: File SASHELP.CLAS.DATA does not exist.
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;that doesn't apply here because when you use %INCLUDE() the code doesn't go to the log, so even if you get an ERROR message it's useless at that point.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is not true.&amp;nbsp; It only doesn't show the code in the log if you tell it not to display the code in the log.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 03:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635717#M188804</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-30T03:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635722#M188805</link>
      <description>&lt;P&gt;But this is only because you didn't set the SOURCE2 option. You can to it with an OPTIONS statement if you don't want to add it to every individual %INCLUDE statement.&amp;nbsp; You can also set the NOSOURCE option and have the code from the main program not displayed in the log.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 04:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635722#M188805</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-30T04:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635723#M188806</link>
      <description>&lt;P&gt;So I need to explicitly specify to tell it to put the code to the log? If I don't, the default is to not include it? Please explain how &lt;STRONG&gt;I told it not to put it in the log&lt;/STRONG&gt;, according to your statement:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;That is not true.&amp;nbsp; It only doesn't show the code in the log if you tell it not to display the code in the log.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 30 Mar 2020 04:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635723#M188806</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-30T04:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635727#M188807</link>
      <description>&lt;P&gt;Run proc options and check. It is your choice what options you set in your command line, config file, autoexec file, program, etc.&amp;nbsp; In addition to SOURCE and SOURCE2 there is MPRINT and MACROGEN.&amp;nbsp; Also MLOGIC and SYMBOLGEN.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 05:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635727#M188807</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-30T05:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: A message to indicate where an error occurs?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635728#M188808</link>
      <description>&lt;P&gt;When running code with potentially unreliable includes, options source2 has to be set.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 05:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-message-to-indicate-where-an-error-occurs/m-p/635728#M188808</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-30T05:46:23Z</dc:date>
    </item>
  </channel>
</rss>

