Operating System - OpenVMS
1826212 Members
2494 Online
109691 Solutions
New Discussion

Re: Empty out a VMS print queue

 
SOLVED
Go to solution
Jorge Cocomess
Super Advisor

Empty out a VMS print queue

Greetings,

Is there a easier way to empty out a VMS queue with one (1) command line? I have hundreds of entries in this queue and it would take a good 1 hour to empty it by a simgle del/entry=xxx

Please help.

Thank you in advance.
Jorge
12 REPLIES 12
Volker Halle
Honored Contributor
Solution

Re: Empty out a VMS print queue

Jorge,

note the queue configuration (SHO QUE/FULL) and delete the queue with: DELETE/QUEUE queue-name. Then re-create the queue with the previously documented settings.

Volker.
Jorge Cocomess
Super Advisor

Re: Empty out a VMS print queue

I get an error deleting the queue. And yes, I did stopped the queue prior deleting it.
Karl Rohwedder
Honored Contributor

Re: Empty out a VMS print queue

Jorgem
did you do a STOP/QUE/NEXT? perhaps this is an execution queue with a generic queue pointing to it? Then you have to stop/delete the generic queue 1st.

regards Kalle
Jefferson Humber
Honored Contributor

Re: Empty out a VMS print queue

Hi Jorge,

I had a little .COM file once that did what you are after, since I couldn't find a way to do it from a single command.

I think it worked with a bit of F$GETQUI in a loop.

I'll have a hunt around and see if I can find it, can't promise it's still about though it was a few years ago.

Jeff
I like a clean bowl & Never go with the zero
Jefferson Humber
Honored Contributor

Re: Empty out a VMS print queue

Jorge Cocomess
Super Advisor

Re: Empty out a VMS print queue

Jeff - Works like a charm in 7.3-2

~Many thanks!!

J
Gregg Parmentier
Frequent Advisor

Re: Empty out a VMS print queue


I think this one is a bit more efficient than the one at the search link, since it doesn't have to loop to find the correct print queue. If you have lots of queues, this might make a noticable difference.

It also checks only printer and terminal queues so you can't acidentally clean out an execution queue with a typo. The I/O syntax might not be as clean, though:-)

$ If (P1.NES."")
$ THEN
$ WHICH_Q = P1
$ ELSE
$ READ/END=DONE/PROMPT="Enter the name of the queue you wish to clean: " -
SYS$COMMAND WHICH_Q
$ IF WHICH_Q .EQS. "" THEN GOTO DONE
$ ENDIF
$
$! check queue existence and set context
$ Q_NAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","''which_q'","PRINTER,TERMINAL,WILDCARD")
$ IF Q_NAME .EQS. "" THEN GOTO NO_QUEUE
$ STOP/QUEUE/RESET 'Q_NAME'
$
$LOOP:
$! get the next entry number and delete it from the queue
$ ENTRY == F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"ALL_JOBS,WILDCARD")
$ IF (ENTRY.EQS."") THEN GOTO DONE
$ DELETE/ENTRY='ENTRY' 'Q_NAME'
$ GOTO LOOP
$
$NO_QUEUE:
$ WRITE SYS$OUTPUT "Queue ''which_q' does not exist."
$
$DONE:
$! clear queue context
$ Q_NAME = F$GETQUI("")
Jess Goodman
Esteemed Contributor

Re: Empty out a VMS print queue

The easiest way to empty out a batch or print queue takes 3 lines of DCL:

$ INIT /QUEUE JUNKQ !add /BATCH or /DEVICE
$ ASSIGN/MERGE JUNKQ the_real_q
$ DELETE/QUEUE JUNKQ
I have one, but it's personal.
Karl Rohwedder
Honored Contributor

Re: Empty out a VMS print queue

Attached is a small procedure, that moves queue entries to/from a 'dummy' queue, in order to allow maintenance on the original queue.

regards Kalle
Wim Van den Wyngaert
Honored Contributor

Re: Empty out a VMS print queue

I like the solution of Jess. Didn't think of it (esp. when you are without your toolkit).

Wim
Wim
Galen Tackett
Valued Contributor

Re: Empty out a VMS print queue

In 20+ years with VMS I don't recall coming across Jess's solution ever before (but my memory is pretty bad these days.) It is efficient, clever, and elegant (in a sort of mathematical sense.)
Joseph Huber_1
Honored Contributor

Re: Empty out a VMS print queue

My solution, which lets select jobs by user,by name, or by queue name:

http://wwwvms.mppmu.mpg.de/util_root/com/abojob.com
http://www.mpp.mpg.de/~huber