Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

SYS$Batch Job Will Not Complete - Receive Pending Status Caused by Queue Busy State

 
SOLVED
Go to solution
Highlighted
Bushytea
Occasional Advisor

SYS$Batch Job Will Not Complete - Receive Pending Status Caused by Queue Busy State

Hello All,

I have a printer que that is setup in such a way that it will not print to an actual physical printer. This queue is just used for users to send print jobs to that they do not actually need printed. However, this queue over time starts to fill up with a lot of unprocessed jobs.

So, I have been working on a way to setup a sys$batch job to clear out this printer que each morning.

The problem that I am having is that the job kicks off just fine and the printer que does get cleared but the batch job appears to be caught in a loop. It keeps trying to process the batch job over and over again. The only way to stop it at that time is to delete the .COM file.

Below is what I am getting in the log files.

$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
Job CLRPACLAIMSQUE (queue SYS$BATCH, entry 703) pending
pending status caused by queue busy state
xxxxxx job terminated at 3-MAY-2016 09:06:16.20

Accounting information:
Buffered I/O count: 78 Peak working set size: 4576
Direct I/O count: 23 Peak virtual size: 177920
Page faults: 489 Mounted volumes: 0
Charged CPU time: 0 00:00:00.02 Elapsed time: 0 00:00:00.04


Below is the code in my .com file itself.

 

$ !CLRPACLAIMSQUE.COM
$ !
$ !
$ !CLEAR PACLAIMS VIRTUAL PRINTER
$ !--------------------------------------------------------------------------
$ !
$ DEFINE/USER  SYS$INPUT   SYS$COMMAND            !
$ set noon
$ !
$ SET QUEUE/CLOSE PACLAIMS	!CLOSE QUE PACLAIMS
$ INIT/QUEUE JUNKQ              !DUMMY QUE
$ ASSIGN/MERGE JUNKQ PACLAIMS   !DUMMY QUE REAL QUE
$ DELETE/QUEUE JUNKQ            !DUMMY QUE
$ SET QUEUE/OPEN PACLAIMS	!OPEN QUE PACLAIMS
$ !
$ END:
$ SUBMIT COD:CLRPACLAIMSQUE.COM/AFTER="TODAY+00:06:00"/NOPRINT/KEEP
$ exit
3 REPLIES 3
Volker Halle
Honored Contributor
Solution

Re: SYS$Batch Job Will Not Complete - Receive Pending Status Caused by Queue Busy State

Do you see the problem ?

AXPVMS $ write sys$output f$cvtime("TODAY+00:06:00","ABSOLUTE")
9-JUN-2016 00:06:00.00

This submit command will cause the job to run and re-submit itself, so the job will continuously re-submit itself in a close loop until midnight ! And then run again starting at 00:06

Consider using SUBMIT/AFTER=("TOMORROW+06:00:00") instead, if you want to run the job to run at 06:00 each morning.

 

Volker.

Bushytea
Occasional Advisor

Re: SYS$Batch Job Will Not Complete - Receive Pending Status Caused by Queue Busy State

Hi Volker,

I must not have been thinking on this one. I tried a few different ways to submit the job for testing but now that I think about it they all involving submitting the job for today. I should have commented out the submit line in the file and just submitted the job using the command "SUBMIT JOBNAME" to test the code first. 

I have set the job to run tomorrow morning so we will see how it goes. 

Thanks again,
Michael

Hoff
Honored Contributor

Re: SYS$Batch Job Will Not Complete - Receive Pending Status Caused by Queue Busy State

Use a null symbiont.   Various of these have been made available over the years.  Here's one:

http://www.digiater.nl/openvms/freeware/v80/dbs-nullsymbiont/

Similarly, execsymb can be handy for these (and for other) cases:

http://www.digiater.nl/openvms/freeware/v80/execsymb/