- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- setting exit code for submit job
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-25-2005 08:26 AM
тАО07-25-2005 08:26 AM
JOB_COMPLETION_STATUS I recieve from sys$sndjbc (0, SJC$_SYNCHRONIZE_JOB ...) is what I use to set the status of the batch job.
One of the requirement that has come-up is that
the status of the batch job should be the exit status set inside the batch script. Where is the value of exit status stored?
Below are two example of the batch job
$! type test.com
$ show time
$ exit 0
$! type test1.com
$ show time
$ exit 1
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-25-2005 09:33 AM
тАО07-25-2005 09:33 AM
Re: setting exit code for submit job
Status codes in VMS have well defined meanings, expressed in bit-Vields.
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.
An other startng point to read is $HELP EXIT PARAM
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-25-2005 11:13 AM
тАО07-25-2005 11:13 AM
Re: setting exit code for submit job
Thanks for the reply. If I change the batch file to,
$! type test.com
$ show time
$ exit $STATUS
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-25-2005 06:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 04:02 AM
тАО07-26-2005 04:02 AM
Re: setting exit code for submit job
even simpler:
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!
hth,
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 05:37 AM
тАО07-26-2005 05:37 AM
Re: setting exit code for submit job
Thanks for the reply.
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?
struct VMSiosb
{
int Status;
int DeviceInfo;
} IOsb;
int status;
...
...
status = sys$sndjbc (0, SJC$_SYNCHRONIZE_JOB, 0, &items, &IOsb, 0, 0);
if (status != SS$_NORMAL)
{
retstatus = status;
}
fprintf(stdout,"***DEBUG 1*** status = %d\n",status);
fprintf(stdout,"***DEBUG 1*** IOsb.status = %d\n",IOsb.Status);
fflush(stdout);
status = sys$synch (0, &IOsb);
if (status != SS$_NORMAL)
{
return(-1);
}
fprintf(stdout,"***DEBUG 2*** status = %d\n",status);
fprintf(stdout,"***DEBUG 2*** IOsb.status = %d\n",IOsb.Status);
fflush(stdout);
....
....
For exit = 1 or exit = 0 ( odd or even value), I always get the following values,
*** DEBUG 1 *** status = 1
*** DEBUG 1 *** IOsb.status = 0
*** DEBUG 2 *** status = 1
*** DEBUG 2 *** IOsb.status = 262145
Please help.
Thanks
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 06:14 AM
тАО07-26-2005 06:14 AM
Re: setting exit code for submit job
could you try to specify the output item code SJC$_JOB_COMPLETION_STATUS to receive the job completion status ?
The IOsb value of 262145 has the following meaning:
$ write sys$output f$message(262145)
%JBC-S-NORMAL, normal successful completion
This looks like the status of the $SNDJBC system service and NOT like the status of the job.
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2005 09:30 AM
тАО07-26-2005 09:30 AM
Re: setting exit code for submit job
Thanks for all the help.
Sandeep