1827620 Members
3254 Online
109966 Solutions
New Discussion

VMS & Print Queues

 
SOLVED
Go to solution
Jorge Cocomess
Super Advisor

VMS & Print Queues

Greetings,

I would like to know how I can delete all the print jobs within a queue without have to delete one job at a time? These are the steps I'm currently doing:
1. sho que/all hp5si_mis /out=delete_que.out
2. Typ delete_que.out and delete one job at a time.

I am currently running OpenVMS 7.3-2

Thanks,
J

13 REPLIES 13
David B Sneddon
Honored Contributor

Re: VMS & Print Queues

If you wish to delete ALL the jobs, just delete
the queue and recreate it...

Dave
David B Sneddon
Honored Contributor

Re: VMS & Print Queues

Another way, we have a BLACK_HOLE queue on each
system using the NULLSYMBIONT. Merge the print
queue into the BLACK_HOLE queue.

$ ASSIGN/MERGE BLACK_HOLE HP5SI_MIS

Dave
Jorge Cocomess
Super Advisor

Re: VMS & Print Queues

David - What's the proper procedures to delete the queue and recreate it? Can you delete a queue with print jobs in it?

Thanks,
J
David B Sneddon
Honored Contributor

Re: VMS & Print Queues

$ stop/queue/reset hp5si_mis

This stops any currently printing jobs.

$ delete/queue hp5si_mis

will delete the queue.

As far as recreating the queue, do you not have
some procedure somewhere that will initialize
your queues? How do you create the queues if you
have a problem or if someone "accidentally" deletes
a queue?

If you don't have a procedure to do this, you
may want to look at setting one up...
You can always create a dummy queue and do a merge.

$ initialize/queue dummyq/on=lta666:
$ stop/queue/reset hp5si_mis
$ assign/merge dummyq hp5si_mis
$ delete/queue dummyq


Dave.
Steven Schweda
Honored Contributor

Re: VMS & Print Queues

It's also possible to use the (very flexible,
hence complicated) F$GETQUI() lexical
function to step through all the jobs in a
queue and do whatever you want to do with
each one (delete, for example). Sadly, I
don't have a good example handy.

It's still "one at a time", but automatic
instead of manual.
Steven Schweda
Honored Contributor

Re: VMS & Print Queues

It's not a complete solution, but here's a
procedure which shows some of the basics for
using F$GETQUI().

alp $ @ QUEUE_LIST.COM

Queue SYS$BATCH_ALP on node ALP:
job: CWU1_SUB entry: 950 status: 0002
job: RUN_DTSS_NTP entry: 85 status: 0002
job: WWW_FLUSH entry: 465 status: 0200
job: WWW_TEST entry: 469 status: 0200
job: DAILY entry: 220 status: 0200


If you care, the status values are described in

SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]QUIDEF.H

Look for "JOB_STATUS item code". For
example:

#define QUI$M_JOB_EXECUTING 0x2
#define QUI$M_JOB_TIMED_RELEASE 0x200 ("Holding until ...")

I've shown it listing out a batch queue, but
it should work on any type of queue. (I
normally don't have any jobs in a print
queue, so that display would be less
interesting.)
Steven Schweda
Honored Contributor

Re: VMS & Print Queues

To recover some reasonable file attributes
on that attachment, try:

set file /attr = (rfm: stmlf) 271096.TXT

Karl Rohwedder
Honored Contributor

Re: VMS & Print Queues

Sidenote: The freeware V5 contains a nice
graphical (SMG) management tool to device queues called PQM.

regards Kalle
Heinz W Genhart
Honored Contributor
Solution

Re: VMS & Print Queues

Hi Jorge

I wrote a commandfile some time ago, which emties a Queue


$ sav_ver=F$VERIFY(0)
$ debug=0
$ IF F$TRNLNM("TOOL_DEBUG") THEN debug=1
$ IF debug THEN SET VERIFY
$ ON CONTROL_Y THEN GOTO clean_up
$ ON WARNING THEN GOTO clean_up
$ sts=1
$ sav_def=F$ENVIRONMENT("DEFAULT")
$ sav_mes=F$ENVIRONMENT("MESSAGE")
$ this_user=F$GETJPI("","USERNAME")
$ this_node=F$GETSYI("NODENAME")
$ this_proc=F$ENVIRONMENT("PROCEDURE")
$ mode=F$MODE()
$! ------------------------------------------
$ SET NOON
$!
$ IF P1 .EQS. "" THEN INQUIRE P1 "Enter Name of Queue where jobs will be deleted "
$ qname = P1
$ temp = F$GETQUI("CANCEL_OPERATION")
$ IF qname .EQS. "" THEN GOTO clean_up
$loop1:
$ qstop = F$GETQUI("DISPLAY_QUEUE", "QUEUE_STOPPED", QNAME, "WILDCARD")
$check_jobs:
$ inaccessible = F$GETQUI("DISPLAY_JOB", "JOB_INACCESSIBLE", , "ALL_JOBS")
$ IF inaccessible .EQS. "" THEN GOTO clean_up
$ job_name = F$GETQUI("DISPLAY_JOB", "JOB_NAME", , "FREEZE_CONTEXT,ALL_JOBS")
$ entry_number = F$GETQUI("DISPLAY_JOB", "ENTRY_NUMBER", , "FREEZE_CONTEXT,ALL_JOBS")
$ username = F$GETQUI("DISPLAY_JOB", "USERNAME", , "FREEZE_CONTEXT,ALL_JOBS")
$ WRITELN SYS$OUTPUT "Deleting Job ''job_name' entry ''entry_number' of ''username' in Queue ''qname'"
$ DELETE/ENTRY='entry_number'
$ GOTO check_jobs
$!
$!
$! ----------------------------------------
$clean_up:
$ SET DEFAULT 'sav_def'
$ SET MESSAGE 'sav_mes'
$ sav_ver=F$VERIFY(sav_ver)
$ EXIT 'sts'


Hope that helps

Regards

Heinz
Robert_Boyd
Respected Contributor

Re: VMS & Print Queues

Jorge,

I posted a procedure DELETE_OLD_PRINT_JOBS.COM to the dcl.OpenVMS.org website. This procedure will delete all jobs older than a specified delta time from queues.

The procedure will probably be available from that site tomorrow.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: VMS & Print Queues

Here is a copy of DELETE_OLD_PRINT_JOBS.COM as an attachment.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Jorge Cocomess
Super Advisor

Re: VMS & Print Queues

Robert - Thanks for the COM procedure, that worked.

You guys are the best!! All the points for this subject has been posted.

Thank you!!

J
Ian Miller.
Honored Contributor

Re: VMS & Print Queues

the procedure is at
http://dcl.openvms.org/stories.php?story=06/01/24/9856430

be sure to have a look at the others available at http://dcl.openvms.org
____________________
Purely Personal Opinion