<?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: setting exit code for submit job in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914418#M32432</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the exit status of the job, you synchronize to, is available from the IOSB quadword parameter.&lt;BR /&gt;&lt;BR /&gt;See HELP SYSTEM_SERVICES $SNDJBC&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
    <pubDate>Tue, 26 Jul 2005 01:07:47 GMT</pubDate>
    <dc:creator>Volker Halle</dc:creator>
    <dc:date>2005-07-26T01:07:47Z</dc:date>
    <item>
      <title>setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914415#M32429</link>
      <description>I use sys$sndjbc to submit job and monitor them for the job completion. &lt;BR /&gt;&lt;BR /&gt;JOB_COMPLETION_STATUS I recieve from sys$sndjbc (0, SJC$_SYNCHRONIZE_JOB ...) is what I use to set the status of the batch job.&lt;BR /&gt;&lt;BR /&gt;One of the requirement that has come-up is that &lt;BR /&gt;the status of the batch job should be the exit status set inside the batch script. Where is the value of exit status stored?&lt;BR /&gt;&lt;BR /&gt;Below are two example of the batch job &lt;BR /&gt;&lt;BR /&gt;$! type test.com&lt;BR /&gt;$ show time &lt;BR /&gt;$ exit 0&lt;BR /&gt;&lt;BR /&gt;$! type test1.com&lt;BR /&gt;$ show time &lt;BR /&gt;$ exit 1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jul 2005 15:26:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914415#M32429</guid>
      <dc:creator>Sandeep_30</dc:creator>
      <dc:date>2005-07-25T15:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914416#M32430</link>
      <description>RTFM. &lt;BR /&gt;Status codes in VMS have well defined meanings, expressed in bit-Vields.&lt;BR /&gt;&lt;BR /&gt;You don't want to use 0 or 1 as status and if you do, then 1 should be succes and 0 failure (contrary to Unix). But really the lower bit alone defines succes or failure.&lt;BR /&gt;&lt;BR /&gt;An other startng point to read is $HELP EXIT PARAM&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jul 2005 16:33:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914416#M32430</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-07-25T16:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914417#M32431</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply. If I change the batch file to,&lt;BR /&gt;&lt;BR /&gt;$! type test.com&lt;BR /&gt;$ show time&lt;BR /&gt;$ exit $STATUS&lt;BR /&gt;&lt;BR /&gt;Now when I submit the above file to a batch queue using SYS$SNDJBC call. What command should I use to capture (read) the status value that exit has?&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jul 2005 18:13:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914417#M32431</guid>
      <dc:creator>Sandeep_30</dc:creator>
      <dc:date>2005-07-25T18:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914418#M32432</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the exit status of the job, you synchronize to, is available from the IOSB quadword parameter.&lt;BR /&gt;&lt;BR /&gt;See HELP SYSTEM_SERVICES $SNDJBC&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 26 Jul 2005 01:07:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914418#M32432</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2005-07-26T01:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914419#M32433</link>
      <description>Sandeep,&lt;BR /&gt;&lt;BR /&gt;even simpler:&lt;BR /&gt;&lt;BR /&gt;Provided you issue the SYNCHRONISE command before the batchjob finishes, the value of $STATUS after the SYNCHRONISE command will be the EXIT STATUS value of the batch job!&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Tue, 26 Jul 2005 11:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914419#M32433</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2005-07-26T11:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914420#M32434</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;Below is part of the source, that I tried but I am still not able to get the exit value correctly. Can you please take a look and help  me understand what I did wrong?&lt;BR /&gt;&lt;BR /&gt;struct VMSiosb&lt;BR /&gt;{&lt;BR /&gt; int  Status;&lt;BR /&gt; int  DeviceInfo;&lt;BR /&gt;} IOsb;&lt;BR /&gt; &lt;BR /&gt;int status;&lt;BR /&gt; &lt;BR /&gt; ...&lt;BR /&gt; ...&lt;BR /&gt; &lt;BR /&gt;status = sys$sndjbc (0, SJC$_SYNCHRONIZE_JOB, 0, &amp;amp;items, &amp;amp;IOsb, 0, 0);&lt;BR /&gt;if (status != SS$_NORMAL)&lt;BR /&gt;{&lt;BR /&gt; retstatus = status;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;fprintf(stdout,"***DEBUG 1*** status = %d\n",status);&lt;BR /&gt;fprintf(stdout,"***DEBUG 1*** IOsb.status = %d\n",IOsb.Status);&lt;BR /&gt;fflush(stdout);&lt;BR /&gt;&lt;BR /&gt;status = sys$synch (0, &amp;amp;IOsb);&lt;BR /&gt;if (status != SS$_NORMAL)&lt;BR /&gt;{&lt;BR /&gt; return(-1);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;fprintf(stdout,"***DEBUG 2*** status = %d\n",status);&lt;BR /&gt;fprintf(stdout,"***DEBUG 2*** IOsb.status = %d\n",IOsb.Status);&lt;BR /&gt;fflush(stdout);&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;.... &lt;BR /&gt;&lt;BR /&gt;For exit = 1 or exit = 0 ( odd or even value), I always get the following values,&lt;BR /&gt;&lt;BR /&gt;*** DEBUG 1 *** status = 1&lt;BR /&gt;*** DEBUG 1 *** IOsb.status = 0&lt;BR /&gt;*** DEBUG 2 *** status = 1&lt;BR /&gt;*** DEBUG 2 *** IOsb.status = 262145&lt;BR /&gt;&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Sandeep</description>
      <pubDate>Tue, 26 Jul 2005 12:37:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914420#M32434</guid>
      <dc:creator>Sandeep_30</dc:creator>
      <dc:date>2005-07-26T12:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914421#M32435</link>
      <description>Sandeep,&lt;BR /&gt;&lt;BR /&gt;could you try to specify the output item code SJC$_JOB_COMPLETION_STATUS to receive the job completion status ?&lt;BR /&gt;&lt;BR /&gt;The IOsb value of 262145 has the following meaning:&lt;BR /&gt;&lt;BR /&gt;$ write sys$output f$message(262145)&lt;BR /&gt;%JBC-S-NORMAL, normal successful completion&lt;BR /&gt;&lt;BR /&gt;This looks like the status of the $SNDJBC system service and NOT like the status of the job.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 26 Jul 2005 13:14:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914421#M32435</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2005-07-26T13:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: setting exit code for submit job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914422#M32436</link>
      <description>SJC$_JOB_COMPLETION_STATUS resolved the issue.&lt;BR /&gt;&lt;BR /&gt;Thanks for all the help.&lt;BR /&gt;&lt;BR /&gt;Sandeep</description>
      <pubDate>Tue, 26 Jul 2005 16:30:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/setting-exit-code-for-submit-job/m-p/4914422#M32436</guid>
      <dc:creator>Sandeep_30</dc:creator>
      <dc:date>2005-07-26T16:30:53Z</dc:date>
    </item>
  </channel>
</rss>

