HP OpenVMS Systems

ask the wizard
Content starts here

Stopping and restarting batch queue entries?

» close window

The Question is:

 
I am attempting to update a backup command file to stop certain processes
 during the backup and then restart them at the end of the backup. There is a
 process that runs in Sys$batch. Is there a procedure to delete or stop the
 running job without knowing w
hat the job number is so I can make it part of the command file? I do not want
 to stop the queue and start it again as the backup also runs in that queue. If
 there is not a way to stop it through a procedure command other than
 del/ent="number". Is there a
 way to extract the first 7 character positions from a text file to use it as
 the value of a variable ie. del/ent=P1 where P1="the first 7 characters of
 testfile"
 
Thank you
 


The Answer is :

 
$! This command procedure shows all queues and the jobs in them.
$  TEMP = F$GETQUI("")
$QLOOP:
$  QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")
$  IF QNAME .EQS. "" THEN EXIT
$  WRITE SYS$OUTPUT ""
$  WRITE SYS$OUTPUT "QUEUE: ", QNAME
$  JLOOP:
$  NOACCESS = F$GETQUI("DISPLAY_JOB","JOB_INACCESSIBLE",,"ALL_JOBS")
$  IF NOACCESS .EQS. "TRUE" THEN GOTO JLOOP
$  IF NOACCESS .EQS. "" THEN GOTO QLOOP
$  UNAME = F$GETQUI("DISPLAY_JOB","USERNAME",,"FREEZE_CONTEXT,ALL_JOBS")
$  JNAME = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT,ALL_JOBS")
$  ENTRY = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT,ALL_JOBS")
$  UNAME = F$EDIT(UNAME,"COLLAPSE,UPCASE")
$  JNAME = F$EDIT(JNAME,"COLLAPSE,UPCASE")
$  WRITE SYS$OUTPUT "    JOB:  ", JNAME
$  WRITE SYS$OUTPUT "    USERNAME:  ", UNAME
$  WRITE SYS$OUTPUT "    ENTRY:  ", ENTRY
$  GOTO JLOOP
 
 
  Existing discussions of the f$getqui lexical include the following
  topics: (813), (1240), (2159), (3951), (4546), (4568), (4903), (5188)
  (5471), (5567), (5651), (5793), (5982), (6315), (6877), etc.
 

answer written or last revised on ( 15-AUG-2001 )

» close window