<?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 How to get return code of a sh job which calls a sas job inside a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416945#M102398</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ahve to execute a batch scripts(sh script) which calls a SAS job inside a macro, I have to check the return code of the same . How to do ?&lt;/P&gt;&lt;P&gt;%do i=1 to &amp;amp;max;/*Max holds 9 thats 9 jobs*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let path = /app/jobs;&lt;/P&gt;&lt;P&gt;x "&amp;amp;path/&amp;amp;&amp;amp;jobs&amp;amp;i...&amp;amp;extn";/*extn is sh*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;%if rc ge 0 /*I have to do this but unabel to get rc value*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly advise&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Sandhya S&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2017 03:35:50 GMT</pubDate>
    <dc:creator>Sandy10</dc:creator>
    <dc:date>2017-11-29T03:35:50Z</dc:date>
    <item>
      <title>How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416945#M102398</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ahve to execute a batch scripts(sh script) which calls a SAS job inside a macro, I have to check the return code of the same . How to do ?&lt;/P&gt;&lt;P&gt;%do i=1 to &amp;amp;max;/*Max holds 9 thats 9 jobs*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let path = /app/jobs;&lt;/P&gt;&lt;P&gt;x "&amp;amp;path/&amp;amp;&amp;amp;jobs&amp;amp;i...&amp;amp;extn";/*extn is sh*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;%if rc ge 0 /*I have to do this but unabel to get rc value*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly advise&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Sandhya S&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 03:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416945#M102398</guid>
      <dc:creator>Sandy10</dc:creator>
      <dc:date>2017-11-29T03:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416963#M102406</link>
      <description>&lt;P&gt;First of all you need to make sure that the shell script returns the RC from SAS. After executing an external command, check the &amp;amp;sysrc automatic macro variable. It contains the return code from the x statement.&lt;/P&gt;
&lt;P&gt;For reference, see here:&amp;nbsp;&lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p07ugdul4v0llpn1denhfknmr7sb.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p07ugdul4v0llpn1denhfknmr7sb.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 05:44:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416963#M102406</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-29T05:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416974#M102408</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. How to check the return code of a SAS job which was executed using below statement ?&lt;BR /&gt;&lt;BR /&gt;%include /app/jobs/J_ABC.sas";&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards&lt;BR /&gt;Sandhya S</description>
      <pubDate>Wed, 29 Nov 2017 07:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416974#M102408</guid>
      <dc:creator>Sandy10</dc:creator>
      <dc:date>2017-11-29T07:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416976#M102409</link>
      <description>%include execute the code in the calling session, hence no session rc.</description>
      <pubDate>Wed, 29 Nov 2017 07:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416976#M102409</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-11-29T07:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416977#M102410</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;I understand that . But if there anyway i can know whether the job is successful or not?</description>
      <pubDate>Wed, 29 Nov 2017 07:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416977#M102410</guid>
      <dc:creator>Sandy10</dc:creator>
      <dc:date>2017-11-29T07:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416978#M102411</link>
      <description>&lt;P&gt;Since included code is always executed in the context of your local SAS, check &lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=p11nt7mv7k9hl4n1x9zwkralgq1b.htm" target="_blank"&gt;&amp;amp;syscc&lt;/A&gt; for the current return code status.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also read through the documentation of the &lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p129w4k1psvpucn1rgfeaoq5j49j.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=de" target="_blank"&gt;other automatic macro variables&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 07:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416978#M102411</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-29T07:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get return code of a sh job which calls a sas job inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416996#M102412</link>
      <description>&lt;P&gt;Not sure what you mean by "Job" in this context.&lt;/P&gt;
&lt;P&gt;For the "calling" session there will be a rc of course, but the included code is &lt;EM&gt;not&lt;/EM&gt; a job.&lt;/P&gt;
&lt;P&gt;If you want to monitor individual steps you can check rc for these.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I try to read between the lines, I think you want to monitor each program separately, and the %include's are not a good choice.&lt;/P&gt;
&lt;P&gt;Better to set job flows up in a decent scheduler, and have that as a central point of control.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 09:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-return-code-of-a-sh-job-which-calls-a-sas-job-inside/m-p/416996#M102412</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-11-29T09:44:01Z</dc:date>
    </item>
  </channel>
</rss>

