<?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 Fetching return codes from a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fetching-return-codes-from-a-macro/m-p/396256#M95648</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a macro which is being called from a JAVA program and has certain validations in it. If the validation fails code goes to exit label and does clean up and exits. Now based on the error codes/error text of these custom validation, the value is updated in the database along with the status SUCCESS/FAILURE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The validations looks something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysevalf(%superq(abc)	=, boolean)=1 %then %do;
	 %put ===========================Problem Code==========================;
      %put;
      %put;
      %put  %str(ERR)OR: (&amp;amp;sysmacroname) The value of parameter abc is empty ;  
      %put;
      %put;
      %put ====================Usage for Macro &amp;amp;sysmacroname================;
      %goto exit;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now, I want to capture the error messages from the program after it completes execution. Pleasehelp me in doing so. There are certain automatic variables like syserr, syscc &amp;amp; sysrc, but I am not sure how to use them.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2017 11:02:26 GMT</pubDate>
    <dc:creator>Arjumand</dc:creator>
    <dc:date>2017-09-15T11:02:26Z</dc:date>
    <item>
      <title>Fetching return codes from a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fetching-return-codes-from-a-macro/m-p/396256#M95648</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a macro which is being called from a JAVA program and has certain validations in it. If the validation fails code goes to exit label and does clean up and exits. Now based on the error codes/error text of these custom validation, the value is updated in the database along with the status SUCCESS/FAILURE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The validations looks something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysevalf(%superq(abc)	=, boolean)=1 %then %do;
	 %put ===========================Problem Code==========================;
      %put;
      %put;
      %put  %str(ERR)OR: (&amp;amp;sysmacroname) The value of parameter abc is empty ;  
      %put;
      %put;
      %put ====================Usage for Macro &amp;amp;sysmacroname================;
      %goto exit;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now, I want to capture the error messages from the program after it completes execution. Pleasehelp me in doing so. There are certain automatic variables like syserr, syscc &amp;amp; sysrc, but I am not sure how to use them.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 11:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fetching-return-codes-from-a-macro/m-p/396256#M95648</guid>
      <dc:creator>Arjumand</dc:creator>
      <dc:date>2017-09-15T11:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching return codes from a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fetching-return-codes-from-a-macro/m-p/396276#M95653</link>
      <description>&lt;P&gt;Look at setting the &lt;A href="http://support.sas.com/documentation/cdl/en/hostunx/69602/HTML/default/viewer.htm#n00se9h5vrwqrbn1uu4nb0yysmdl.htm" target="_blank"&gt;stdio system option&lt;/A&gt;. That way you can write output to stdout and log to stderr, and catch those streams in Java.&lt;/P&gt;
&lt;P&gt;You can also use the abort abend &lt;EM&gt;n&lt;/EM&gt;; statement (or %abort macro statement) to end the SAS job immediately and set a return code.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 11:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fetching-return-codes-from-a-macro/m-p/396276#M95653</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-15T11:19:01Z</dc:date>
    </item>
  </channel>
</rss>

