1748272 Members
4363 Online
108760 Solutions
New Discussion юеВ

Re: Retained batch job

 
Wim Van den Wyngaert
Honored Contributor

Retained batch job

Why is the following job retained ?

SALPV1/MGRWVW>sh que ARB$BATCH_SALPV1/all/fu
Batch queue ARB$BATCH_SALPV1, idle, on SALPV1::
/AUTOSTART_ON=(SALPV1::) /BASE_PRIORITY=3 /JOB_LIMIT=10
/OWNER=[SYSMGR,SYSTEM] /PROTECTION=(S:M,O:D,G:R,W:S) /RETAIN=ERROR

Entry Jobname Username Status
----- ------- -------- ------
388 DSM_TRANSFERT_ADHNOS4
DSMMGR Retained on completion
Submitted 7-JUL-2004 09:29:13.76 /KEEP /PARAM=("ADHVAXNT",
"SRV_DOWNLOAD:[DSMPGR]ADHNOS4.VAX","ADHNOS4.VAX") /NOPRINT
/PRIORITY=100
File: _DSA1:[SYSAPP.FAST]FAST_MULTI_TRF.COM;2
Completed 7-JUL-2004 09:29:23.69 on queue ARB$BATCH_SALPV1

Wim
8 REPLIES 8
Willem Grooters
Honored Contributor

Re: Retained batch job

Wim,

Have you looked in the logfile of this job (most likely named FAST_MULTI_TRF.LOG) what error could have occurred? If that dosn't tell you the reason, you can take a look in accounting and lok for this batchjob, it may hold the exit status (and so a reason for retainment)

Willem
Willem Grooters
OpenVMS Developer & System Manager
Wim Van den Wyngaert
Honored Contributor

Re: Retained batch job

Willem,

The exit status was 0, meaning a warning.

In the log file no message was show (and exit 0 was done as last statement).

But I asked retained on ERROR (which means "no success", so retain=warning would have been a better syntax). Why is it retaining the job with "retained on completion" instead of "retained on error".

I tested it with "dir a.b" where a.b doesn't exist. The job ended in "retained on error" for a warning.

Wim
Wim
Willem Grooters
Honored Contributor

Re: Retained batch job

Wim,

Just checked in HELP SET QUE/RETAIN (7.3-1) on options:

ERROR Holds in the queue only jobs that complete unsuccessfully.

Since WARNING is not successfull either (not an odd value), it will cause a job be retained. To prevent this, you should handle that within the commandprocedure.

I must admit this seems a bit odd compared with the DCL ON statement where this dicstinction in severity is possible. You would expect otherwise. Yet another DCL enhancement?

Willem

Willem Grooters
OpenVMS Developer & System Manager
Wim Van den Wyngaert
Honored Contributor

Re: Retained batch job

Willem,

But why is it "retained on completion" in 1 case, "retained on error" in the other. Both for warnings.

Wim
Wim
Willem Grooters
Honored Contributor

Re: Retained batch job

Matter of terminology, be aware these are two distict issues!

Your first output is about the queue itself. This tells the definition, and the specified /RETAIN=ERROR tells that any job that completes in any non-succesfull status is to be retained - on completion, that is. /RETAIN=ALL will retain any job, regardless it's exit status.
So: this is a QUEUE DEFINITION issue

Your second output is about the job itself. It has completed. Normally, jobs will be removed on completion unless specified otherwise. Here, it says the job is retained on copletion. Obviously - since that has been specified, since the job exited with an even (=unsuccessfull) status, as specified in the queue definition.
So: this is a JOB STATUS issue

Retainment happens AT JOB END.
SHO QUEUE gives you the queue definition, that include some attributes the queuemanager will apply at job completion.
It will also show you information of all jobs on that queue that are scheduled (waiting), put on hold and active, and the ones where queuemanager has applied completion actions: /RETAIN, for instance.

If a job appears "Retained on completion", you should look at the queue definition.
You can specify /RETAIN=ALL at the queue definition level, causing all jobs to be retined, regardless it's exit status.
However, did you specify /RETAIN=ERROR, you _know_ something went wrong. If completed successfully, the job would not appear after completion (unless it has been submitted with the /RETAIN option.)

In your case: something went wrong with this one....

HTE

Willem
Willem Grooters
OpenVMS Developer & System Manager
Wim Van den Wyngaert
Honored Contributor

Re: Retained batch job

Willem,

Not clear ...

Why is it "retained on completion" in 1 case (exit 0), "retained on error" in the other.(exit %x10019290). Both for are warnings.

I didn't use submit/retain and the queue always has retain=error.

Wim
Wim
Willem Grooters
Honored Contributor

Re: Retained batch job

Wim,

I may have misunderstood. Do you express:

Case 1:
$ exit 0 --> SHO QUE gives "retained on completion"

Case 2:
$ exit %x10019290 --> SHO QUE gives "retained on error"

Weird, indeed.
Just a wild guess: What's in the code?
Indeed - that _makes_ a difference.

1. create a queue:
init/queue/batch/retain=error/start test

2. created minor command procedure named x.com:

$ case=p1
$ if case .eq. 1
$ then
$ S=0 ! force to some value in DCL
$ else ! this is case 2
$ dir a.b ! which doesn't exits
$ s=$status
$ endif
$ exit 's'

3. submitted this twice to this queue, with different params:

$ submit/que=test x.com/param="1"
$ submit/que=test x.com/param="2"

4. Show status:
$ sho que/full test
Batch queue TEST, idle, on DIANA::
/BASE_PRIORITY=4 /JOB_LIMIT=1 /OWNER=[SYSTEM] /PROTECTION=(S:M,O:D,G:R,W:S)
/RETAIN=ERROR

Entry Jobname Username Status
----- ------- -------- ------
265 x SYSTEM Retained on completion
Submitted 8-JUL-2004 21:39:23.27 /PARAM=("1") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;1
Completed 8-JUL-2004 21:39:26.06 on queue TEST

267 x SYSTEM Retained on error
%RMS-W-FNF, file not found
Submitted 8-JUL-2004 21:39:26.90 /PARAM=("2") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;1
Completed 8-JUL-2004 21:39:29.51 on queue TEST

Someone@hp.com to explain....

What I can think of: by explicitly setting S to some value doesn't trigger severity internally, but an unsuccesful DIR would chnage $STATUS - causing the error flag to be raised. EXIT 0 would be signalled as an unsuccesfull end - causing the job to be retained, but since no error has been flagged, it won't be "on error", merely "on found exit status". EXIT based on $STATUS (in whatever way) would have 'error' flagged, hence 'retained on error'.
Just to prove it:

In stead of
$ S=$STATUS

enter
$S=0

Result after submissions:

$ sho que/full test
Batch queue TEST, idle, on DIANA::
/BASE_PRIORITY=4 /JOB_LIMIT=1 /OWNER=[SYSTEM] /PROTECTION=(S:M,O:D,G:R,W:S)
/RETAIN=ERROR

Entry Jobname Username Status
----- ------- -------- ------
273 x SYSTEM Retained on completion
Submitted 8-JUL-2004 21:54:24.26 /PARAM=("1") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;3
Completed 8-JUL-2004 21:54:27.74 on queue TEST

274 x SYSTEM Retained on completion
Submitted 8-JUL-2004 21:54:26.67 /PARAM=("2") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;3
Completed 8-JUL-2004 21:54:30.33 on queue TEST

now assign some big value:
$ S=%X10010000

and the result is:

$ sho que/full test
Batch queue TEST, idle, on DIANA::
/BASE_PRIORITY=4 /JOB_LIMIT=1 /OWNER=[SYSTEM] /PROTECTION=(S:M,O:D,G:R,W:S)
/RETAIN=ERROR

Entry Jobname Username Status
----- ------- -------- ------
281 x SYSTEM Retained on error
%RMS-W-NORMAL, normal successful completion
Submitted 8-JUL-2004 21:58:12.14 /PARAM=("2") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;5
Completed 8-JUL-2004 21:58:14.70 on queue TEST

283 x SYSTEM Retained on completion
Submitted 8-JUL-2004 21:58:16.74 /PARAM=("1") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;5
Completed 8-JUL-2004 21:58:19.13 on queue TEST
$

(Mind the opposite order - sorry)
It seems to me that the presence of some facility-number in the message makes the difference: yes it does: set both assignments of S to this value (error or no error) and the result is:

$ sho que/full test
Batch queue TEST, idle, on DIANA::
/BASE_PRIORITY=4 /JOB_LIMIT=1 /OWNER=[SYSTEM] /PROTECTION=(S:M,O:D,G:R,W:S)
/RETAIN=ERROR

Entry Jobname Username Status
----- ------- -------- ------
285 x SYSTEM Retained on error
%RMS-W-NORMAL, normal successful completion
Submitted 8-JUL-2004 22:02:06.82 /PARAM=("1") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;6
Completed 8-JUL-2004 22:02:09.22 on queue TEST

287 x SYSTEM Retained on error
%RMS-W-NORMAL, normal successful completion
Submitted 8-JUL-2004 22:02:09.22 /PARAM=("2") /PRIORITY=100
File: _$1$DKA0:[SYS0.SYSMGR]x.com;6
Completed 8-JUL-2004 22:02:11.75 on queue TEST

Ok, it doesn't explain the difference, just the cause.

Willem
Willem
Willem Grooters
OpenVMS Developer & System Manager
Terry Yeomans
Frequent Advisor

Re: Retained batch job

We use this quite often to check printer queues and whether they are working successfully or not.
We do a SET queue_name /RETAIN to check if prints are going through successfully. The only problem is that it gets forgotten for a few months and then you have quite a few entries sitting on the queue !
Do a SET queue_name /NORETAIN to stop the event.
Yours Terry.