After performing the last command in a job, the manager reports the job as complete. If the job is a command procedure, the completion status of job is the status of the last command performed within the procedure.
If the last command in a job is successful, the manager reports a successful completion status. For example, the manager would always report a successful completion status for the following procedure, even if the COPY command failed. The reason is that the last command performed is WRITE SYS$OUTPUT.
$ ON ERROR GOTO ERR_EXIT: $ COPY A.B C.D $ EXIT $ ERR_EXIT: $ WRITE SYS$OUTPUT "file copy failed!" $ EXIT
Because, the completion status can affect the execution of other jobs depending on this job; you can modify your command procedure to exit with the desired status.
To modify the preceding example to complete with the desired status, change the error-handling section as follows:
$ ERR_EXIT: $ SAVED_STATUS = $STATUS $ WRITE SYS$OUTPUT "file copy failed!" $ EXIT SAVED_STATUS
By default, the manager treats failures of any level as job failures. For example, the error %NSCHED-F-JOBSNOTFND is considered a FATAL error by OpenVMS instead of a less severe error. You can control this level by modifying the job status before it finishes; the postfunction is recommended as the place to do this modification. For example, a DCL procedure can be written to verify and change the NSCHED_STATUS symbol to achieve the desired job completion effect. Bits 0–2 of the NSCHED_STATUS can be selected for the severity level of the failure, as listed here. Alternately, the symbol NSCHED_SEVERITY can be tested, with the same result.
The OpenVMS command STOP/ID, when issued for a Job Management Manager job process, causes the process to exit with the status of the last image that was executing. The command turns out to be SUCCESS more often than not, instead of an expected FAILURE or ERROR. The UJM$MANAGER$SHUTDOWN.COM procedure issues SCHED STOP/REQUEUE command which aborts all running jobs before stopping NSCHED process. These jobs are assigned %NSCHED-F-JOBABORT status.
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |