From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX"  9-JUN-1992 15:25:18.76
To:	INFO-VAX@SRI.COM
CC:	
Subj:	USER_JOB_REMOVE.COM and request for WATCHER_MAIL testers

I'm developing a .COM file which parses output from Matt Madison's WATCHER
V2.7 (idle process killer) which will generate a notice for users that can be
Emailed or printed for followup.

I'd like to include this program with Matt's WATCHER, but would appreciate
some help in testing it (it needs some polishing).  If you're interested,
please send me Email.

-----

Attached is a .COM file useful for removing or moving users' jobs from a 
printer queue and generates Email or printed notification of the job that 
was deleted or requeued.  Comments or suggestions welcome.

-Dan Wing, DWING@UH01.Colorado.EDU, WING_D@UCOLMCC.BITNET
 Systems Programmer, University Hospital, Denver

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On  8-JUN-1992 16:32:28.79   By user DWING (DWING@UH01.Colorado.EDU)
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. USER_JOB_REMOVE.COM;87
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X$ USER_JOB_REMOVE$VERSION = "v1.30"
X$
X$!  USER_JOB_REMOVE.COM`20
X$!     Remove jobs from a printer queue, with options to Requeue to another
X$!     printer, or Delete jobs (with Email notification, printed report, or
X$!     no notification).
X$!
X$!     Only PENDING, HOLDING, and RETAINED jobs are affected.
X$!
X$!
X$!  Parameters:
X$!        P1 `5Boptional`5D = Printer queue to process.
X$!                        If omitted, printer queue NO_PRINT will be used.
X$!
X$!  Privileges:
X$!        OPER - to delete print jobs.  If sufficient privileges are setup
X$!               for the queue OPER privilege isn't required.  However, this
X$!               procedure, as written, checks for OPER privilege.
X$!
X$!!!!!
X$!
X$!  Copyright `A9 1992 by University Hospital, Denver, Information Systems`2
V0
X$!  Department.  This program may be freely distributed and modified for no`
V20
X$!  commerical gain as long as this copyright notice is retained.
X$!
X$!  Written by Dan Wing, University Hospital, Denver, DWING@UH01.Colorado.ED
VU
X$!
X$!!!!!
X$!
X$!  REVERSE CHRONOLOGICAL MODIFICATION HISTORY
X$!
X$!  VERSION   EDIT DATE  EDIT  BY   DESCRIPTION
X$!  --------  ---------  ----  ---  ---------------------------------------
X$!  VMS V5.5   3-JUN-92  130   DGW  User can requeue the jobs to another`20
X$!                                  printer.
X$!  VMS V5.5  27-MAY-92  122   DGW  User is given more information.  Fixed
X$!                                  handling if first job found in queue was
X$!                                  not a candidate for deletion.
X$!  VMS V5.5  26-MAY-92  121   DGW  Job status displayed on separate line fr
Vom
X$!                                  filename.
X$!  VMS V5.5  26-MAY-92  120   DGW  New user-selectable actions: delete w/o
X$!                                  notification, and don't delete.
X$!  VMS V5.5  21-MAY-92  111   DGW  Clarify that this mail message doesn't
X$!                                  indicate a problem or that something was
X$!                                  done 'wrong'.  (some people thought they
X$!                                  were going to get in trouble)
X$!  VMS V5.5  14-MAY-92  110   DGW  Identify user that ran this COM file if`
V20
X$!                                  we're sending it to the printer.
X$!  VMS V5.5   5-MAY-92  100   DGW  Created.
X$!
X$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X$
X$  ON WARNING THEN GOTO _ERROR
X$  ON CONTROL_Y THEN GOTO _ABORT
X$  SET SYMBOL/SCOPE=(noGLOBAL)
X$
X$  WRITE SYS$OUTPUT ""
X$  WRITE SYS$OUTPUT ""
X$  WRITE SYS$OUTPUT "USER JOB REMOVE, version ", USER_JOB_REMOVE$VERSION
X$  WRITE SYS$OUTPUT ""
X$
X$!!!
X$
X$  TEMPFILE = "SYS$LOGIN:USER_JOB_REMOVE_" + F$GETJPI(0,"PID") + ".TMP"
X$  TEMPFILE_PRINT = "SYS$LOGIN:USER_JOB_REMOVE_PRINT_" + F$GETJPI(0,"PID") +
V -
X          ".TMP"
X$  OLD_JUSER = ""
X$  SKIP_ENTRY_LIST = ""
X$
X$!!!
X$
X$  IF P1 .EQS. "?" THEN GOTO _HELP
X$
X$  IF .NOT. F$PRIVILEGE("OPER") THEN GOTO _NO_PRIV
X$
X$  IF P1 .EQS. "" THEN P1 = "NO_PRINT"
X$
X$  IF F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",P1,"SYMBIONT") .EQS. ""
X$  THEN
X$    WRITE SYS$OUTPUT "No such printer queue ", P1
X$    GOTO _EXIT
X$  ENDIF
X$
X$
X$  WRITE SYS$OUTPUT ""
X$  WRITE SYS$OUTPUT "Processing the following queue:"
X$  SHOW QUEUE/SUMMARY 'P1'
X$  WRITE SYS$OUTPUT ""
X$  READ SYS$COMMAND OKAY /PROMPT="Is this correct? (Y/N) `5BY`5D " /END_OF_F
VILE=_ABORT
X$  IF (.NOT. OKAY) .AND. (OKAY .NES. "") THEN GOTO _ABORT
X$
X$  WRITE SYS$OUTPUT ""
X$  READ SYS$COMMAND COPY_OTHERS /PROMPT="CC users on Mail notifications? `5B
V`5D "/END_OF_FILE=_ABORT
X$  COPY_OTHERS = F$EDIT(COPY_OTHERS,"UPCASE")
X$  IF COPY_OTHERS .NES. ""
X$  THEN
X$    WRITE SYS$OUTPUT "Other users to CC is: ", COPY_OTHERS
X$    COPY_OTHERS = "," + COPY_OTHERS
X$  ENDIF
X$
X$!!!!!!!!!!!!!!!!!!!!
X$!!!!!!!!!!!!!!!!!!!!
X$
X$  IF F$SEARCH(TEMPFILE_PRINT) .NES. "" THEN DELETE 'TEMPFILE_PRINT';*
X$
X$_NEXT_USERNAME:
X$  IF F$SEARCH(TEMPFILE) .NES. "" THEN DELETE 'TEMPFILE';*
X$  OPEN/WRITE TEMPFILE 'TEMPFILE'
X$  DELETE_ENTRIES = ""
X$
X$  JOB_COUNT = 0
X$  TEMP = F$GETQUI("CANCEL_OPERATION")
X$  QUEUE = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",P1,"WILDCARD,SYMBIONT")
X$  IF QUEUE .EQS. "" THEN GOTO _EXIT
X$
X$  JUSER = F$GETQUI("DISPLAY_JOB","USERNAME",,"WILDCARD,ALL_JOBS")
X$_GET_ANOTHER_ENTRY:
X$  IF JUSER .EQS. "" THEN GOTO _EXIT_QUEUE_LOOP
X$
X$  JENTRY = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT,ALL_JOBS"
V)
X$  IF F$LOCATE(",''JENTRY'",SKIP_ENTRY_LIST) .NE. F$LENGTH(SKIP_ENTRY_LIST)`
V20
X$  THEN`20
X$    JUSER = F$GETQUI("DISPLAY_JOB","USERNAME",,"ALL_JOBS")
X$    GOTO _GET_ANOTHER_ENTRY
X$  ENDIF
X$
X$_JOB_LOOP:
X$  IF OLD_JUSER .NES. JUSER`20
X$  THEN
X$    WRITE SYS$OUTPUT ""
X$    WRITE SYS$OUTPUT "-----"
X$    WRITE SYS$OUTPUT "Processing user ", JUSER
X$    WRITE TEMPFILE "VMS Username: ", JUSER
X$    WRITE TEMPFILE ""
X$    WRITE TEMPFILE ""
X$    WRITE TEMPFILE "As a convenience to you, the following job(s) you submi
Vtted to printer queue"
X$    WRITE TEMPFILE P1, " have been deleted:"
X$    WRITE TEMPFILE ""
X$    WRITE TEMPFILE "  Entry          Job Name                 Blocks   Subm
Vitted at  Status"
X$    WRITE SYS$OUTPUT "  Entry          Job Name                 Blocks   Su
Vbmitted at  Status"
X$    WRITE TEMPFILE "  -----  -------------------------------  ------   ----
V--------  ------"
X$  ENDIF
X$  OLD_JUSER = JUSER
X$  JNAME = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT,ALL_JOBS")
X$  JENTRY = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT,ALL_JOBS"
V)
X$  JFILENAME = F$GETQUI("DISPLAY_FILE","FILE_SPECIFICATION",,"FREEZE_CONTEXT
V,ALL_JOBS")
X$  JSUBMIT = F$GETQUI("DISPLAY_JOB","SUBMISSION_TIME",,"FREEZE_CONTEXT,ALL_J
VOBS")
X$  JBLOCKS = F$GETQUI("DISPLAY_JOB","JOB_SIZE",,"FREEZE_CONTEXT,ALL_JOBS")
X$
X$  JSTATUS = ""
X$  IF F$GETQUI("DISPLAY_JOB","JOB_TIMED_RELEASE",,"FREEZE_CONTEXT,ALL_JOBS")
V THEN JSTATUS = "Timed Release"
X$  IF F$GETQUI("DISPLAY_JOB","JOB_HOLDING",,"FREEZE_CONTEXT,ALL_JOBS") THEN
V JSTATUS = "Holding"
X$  IF F$GETQUI("DISPLAY_JOB","JOB_EXECUTING",,"FREEZE_CONTEXT,ALL_JOBS") THE
VN JSTATUS = "Executing"
X$  IF F$GETQUI("DISPLAY_JOB","JOB_PENDING",,"FREEZE_CONTEXT,ALL_JOBS") THEN
V JSTATUS = "Pending"
X$  IF F$GETQUI("DISPLAY_JOB","JOB_SUSPENDED",,"FREEZE_CONTEXT,ALL_JOBS") THE
VN JSTATUS = "Suspended"
X$  IF F$GETQUI("DISPLAY_JOB","JOB_RETAINED",,"FREEZE_CONTEXT,ALL_JOBS") THEN
V JSTATUS = "Retained"
X$  IF F$GETQUI("DISPLAY_JOB","JOB_STALLED",,"FREEZE_CONTEXT,ALL_JOBS") THEN
V JSTATUS = "Stalled"
X$  IF JSTATUS .EQS. "" THEN JSTATUS = "<unknown>"
X$
X$  IF (JSTATUS .EQS. "Pending") .OR. -
X      (JSTATUS .EQS. "Holding") .OR. -
X      (JSTATUS .EQS. "Timed Release") .OR. -
X      (JSTATUS .EQS. "Retained")
X$  THEN
X$    JSUBMIT = JSUBMIT - "-''F$CVTIME(JSUBMIT,,"YEAR")'"`20
X$    WRITE TEMPFILE -
X     F$FAO("  !4UL   !32AS  !5UL   !12AS  !AS", -
X     JENTRY, -
X     JNAME, -
X     JBLOCKS, -
X     JSUBMIT, -
X     JSTATUS)
X$    WRITE SYS$OUTPUT -
X     F$FAO("  !4UL   !32AS  !5UL   !12AS  !AS", -
X     JENTRY, -
X     JNAME, -
X     JBLOCKS, -
X     JSUBMIT, -
X     JSTATUS)
X$    WRITE TEMPFILE F$FAO("!6* !72AS", JFILENAME)
X$    WRITE TEMPFILE ""
X$    IF DELETE_ENTRIES .EQS. ""
X$    THEN
X$      DELETE_ENTRIES = F$STRING(JENTRY)
X$    ELSE
X$      DELETE_ENTRIES = DELETE_ENTRIES + "," + F$STRING(JENTRY)
X$    ENDIF
X$    JOB_COUNT = JOB_COUNT + 1
X$  ELSE
X$    WRITE SYS$OUTPUT F$FAO("Job !AS, entry !UL, won't be deleted:  Status =
V !AS", JNAME, JENTRY, JSTATUS)
X$    SKIP_ENTRY_LIST = SKIP_ENTRY_LIST + "," + F$STRING(JENTRY)
X$  ENDIF
X$
X$
X$_NEXT_JOB_LOOP:
X$  JUSER = F$GETQUI("DISPLAY_JOB","USERNAME",,"ALL_JOBS,WILDCARD")
X$  IF JUSER .EQS. ""`20
X$  THEN`20
X$    IF JOB_COUNT .GT. 0 THEN GOTO _EXIT_JOB_LOOP
X$    CLOSE TEMPFILE
X$    GOTO _NEXT_USERNAME
X$  ENDIF
X$  IF JUSER .NES. OLD_JUSER THEN GOTO _NEXT_JOB_LOOP
X$  GOTO _JOB_LOOP
X$
X$!!!!!!!!!!!!!!!!!!!!
X$!!!!!!!!!!!!!!!!!!!!
X$ `20
X$_EXIT_JOB_LOOP:
X$  WRITE TEMPFILE F$FAO("Total of !UL job!%S !1%Cwas!%Ewere!%F deleted.", JO
VB_COUNT)
X$  WRITE TEMPFILE ""
X$  WRITE SYS$OUTPUT F$FAO("Total of !UL job!%S !1%Chas!%Ehave!%F been select
Ved for deletion.",JOB_COUNT)
X$
X$_GET_DESIRED_ACTION:
X$  WRITE SYS$OUTPUT "  Desired action:"
X$  WRITE SYS$OUTPUT "    R. Requeue - Send jobs to another printer"
X$  WRITE SYS$OUTPUT "    N. None    - Don't delete jobs"
X$  WRITE SYS$OUTPUT "    P. Print   - Delete jobs and print report of delete
Vd jobs"
X$  WRITE SYS$OUTPUT "    M. Mail    - Delete jobs and Email user report of d
Veleted jobs"
X$  WRITE SYS$OUTPUT "    D. Delete  - Delete jobs, with no notification at a
Vll"
X$  READ SYS$COMMAND ACTION -
X     /PROMPT="  Action (R, N, P, M, D) `5BN`5D ? " /END_OF_FILE=_ABORT
X$  ACTION = F$EXTRACT(0,1,F$EDIT(ACTION,"UPCASE,COLLAPSE"))
X$  IF ACTION .EQS. "" THEN ACTION = "N"
X$
X$!!!
X$
X$  IF ACTION .EQS. "R"
X$  THEN
X$    CLOSE TEMPFILE
X$    READ SYS$COMMAND REQUEUE_QUEUE /PROMPT="Requeue to queue: " /END_OF_FIL
VE=_ABORT
X$    IF REQUEUE_QUEUE .NES. ""
X$    THEN
X$      IF F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",REQUEUE_QUEUE,"SYMBIONT") .N
VES. ""
X$      THEN
X$        SET ENTRY 'DELETE_ENTRIES'/REQUEUE='REQUEUE_QUEUE'
X$        WRITE SYS$OUTPUT F$FAO("The job!0UL!%S !1%Chas!%Ehave!%F been reque
Vued to !AS.", JOB_COUNT, REQUEUE_QUEUE)
X$        GOTO _EXIT_ACTION_CHOICES
X$      ENDIF
X$    ENDIF
X$    WRITE SYS$OUTPUT "Invalid - no such printer queue /", REQUEUE_QUEUE, "/
V"
X$    GOTO _GET_DESIRED_ACTION
X$  ENDIF
X$
X$!!!
X$
X$  IF ACTION .EQS. "D"
X$  THEN
X$    CLOSE TEMPFILE
X$    DELETE/ENTRY=('DELETE_ENTRIES')
X$    WRITE SYS$OUTPUT F$FAO("The job!0UL!%S !1%Chas!%Ehave!%F been deleted."
V, JOB_COUNT)
X$    GOTO _EXIT_ACTION_CHOICES
X$  ENDIF
X$
X$!!!
X$
X$  IF ACTION .EQS. "N"
X$  THEN
X$    CLOSE TEMPFILE
X$    WRITE SYS$OUTPUT "No jobs deleted."
X$    SKIP_ENTRY_LIST = SKIP_ENTRY_LIST + "," + DELETE_ENTRIES
X$    GOTO _EXIT_ACTION_CHOICES
X$  ENDIF
X$ `20
X$!!!
X$
X$  IF ACTION .EQS. "M"
X$  THEN
X$    IF P1 .EQS. "NO_PRINT"
X$    THEN
X$      WRITE TEMPFILE F$FAO("!0UL!1%CThis!%EThese!%F job!%S !1%Cwas!%Ewere!%
VF deleted because you failed to select a printer queue before", JOB_COUNT)
X$      WRITE TEMPFILE F$FAO("you submitted !0UL!1%Cthis!%Ethese!%F job!%S.
V  The queue NO_PRINT is used if you don't specify", JOB_COUNT)
X$      WRITE TEMPFILE "a printer queue.  This does *not* cause a problem --
V this mail message is"
X$      WRITE TEMPFILE F$FAO("just to inform you that !0UL!1%Cthis!%Ethese!%F
V job!%S did not print, and remind you that you need", JOB_COUNT)
X$      WRITE TEMPFILE "to select a printer before attempting to print."
X$    ENDIF
X$    WRITE TEMPFILE ""
X$    WRITE TEMPFILE "For more information about this message, please call 32
V2-HELP, or REPLY"
X$    WRITE TEMPFILE "to this mail message (simply type REPLY at the MAIL pro
Vmpt)."
X$    WRITE TEMPFILE ""
X$    WRITE TEMPFILE "(this mail message was generated automatically by progr
Vam USER_JOB_REMOVE)"
X$    WRITE TEMPFILE ""
X$    CLOSE TEMPFILE
X$    SUBJECT_LINE = F$FAO("Deleted !UL Job!%S from queue !AS (!%D)",JOB_COUN
VT,P1,0)
X$    PERSONAL_LINE = F$FAO("Deleted !UL Job!%S from !AS",JOB_COUNT,P1)
X$    MAIL 'TEMPFILE' 'OLD_JUSER''COPY_OTHERS' -
X     /noSELF -
X     /SUBJECT="''SUBJECT_LINE'" -
X     /PERSONAL="''PERSONAL_LINE'"
X$    WRITE SYS$OUTPUT "User ", OLD_JUSER, " was notified by Email."
X$    DELETE/ENTRY=('DELETE_ENTRIES')
X$    WRITE SYS$OUTPUT F$FAO("The job!0UL!%S !1%Chas!%Ehave!%F been deleted."
V, JOB_COUNT)
X$    GOTO _EXIT_ACTION_CHOICES
X$  ENDIF
X$
X$!!!
X$
X$  IF ACTION .EQS. "P"
X$  THEN`20
X$    WRITE TEMPFILE F$FAO("(USER_JOB_REMOVE executed by user !AS at !%D)", F
V$EDIT(F$GETJPI(0,"USERNAME"),"TRIM"), 0)
X$    WRITE TEMPFILE F$FAO("!78*-")
X$    CLOSE TEMPFILE
X$    APPEND/NEW_VERSION 'TEMPFILE' 'TEMPFILE_PRINT'
X$    DELETE/ENTRY=('DELETE_ENTRIES')
X$    WRITE SYS$OUTPUT F$FAO("The job!0UL!%S !1%Chas!%Ehave!%F been deleted."
V, JOB_COUNT)
X$    GOTO _EXIT_ACTION_CHOICES
X$  ENDIF  ! mail_this_user
X$
X$!!!
X$
X$  WRITE SYS$OUTPUT "Invalid selection."
X$  GOTO _GET_DESIRED_ACTION
X$
X$!!!
X$
X$_EXIT_ACTION_CHOICES:
X$  GOTO _NEXT_USERNAME
X$ `20
X$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X$
X$_EXIT_QUEUE_LOOP:
X$  IF F$SEARCH(TEMPFILE_PRINT) .NES. ""`20
X$  THEN`20
X$  _GET_OUTPUT_PRINTER:
X$    WRITE SYS$OUTPUT ""
X$    READ SYS$COMMAND OUTPUT_PRINTER /PROMPT="Send deleted-jobs report to pr
Vinter queue `5BSYS$PRINT`5D: " /END_OF_FILE=_ABORT
X$    IF OUTPUT_PRINTER .EQS. "" THEN OUTPUT_PRINTER = "SYS$PRINT"
X$    IF F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME",OUTPUT_PRINTER,"SYMBIONT") .EQ
VS. ""
X$    THEN
X$      WRITE SYS$OUTPUT "No such printer queue ", OUTPUT_PRINTER
X$      GOTO _GET_OUTPUT_PRINTER
X$    ENDIF
X$
X$  _GET_USER_NOTE:
X$    READ SYS$COMMAND USER_NOTE /PROMPT="Report note `5BRouting: HELP DESK`5
VD: " /END_OF_FILE=_ABORT
X$    IF USER_NOTE .EQS. "" THEN USER_NOTE = "Routing: HELP DESK"
X$
X$    PRINT 'TEMPFILE_PRINT' -
X     /DELETE -
X     /NOTIFY -
X     /QUEUE='OUTPUT_PRINTER' -
X     /FLAG -
X     /NOTE="''USER_NOTE'" -
X     /NAME="User Job Remove"
X$  ENDIF
X$  WRITE SYS$OUTPUT "Finished processing."
X$
X$_EXIT:
X$  IF F$TRNLNM("TEMPFILE") .NES. "" THEN CLOSE TEMPFILE
X$  IF F$SEARCH(TEMPFILE) .NES. "" THEN DELETE 'TEMPFILE';*
X$  EXIT
X$
X$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
X$_ERROR:
X$  WRITE SYS$OUTPUT "Unexpected error occurred in USER_JOB_REMOVE.COM"
X$  IF F$SEARCH(TEMPFILE_PRINT) .NES. "" THEN WRITE SYS$OUTPUT -
X     "The report of deleted jobs is in ", TEMPFILE_PRINT
X$  GOTO _EXIT
X$
X$_ABORT:
X$  WRITE SYS$OUTPUT "USER_JOB_REMOVE.COM aborted by user."
X$  TEMP = F$GETQUI("CANCEL_OPERATION")
X$  GOTO _EXIT
X$
X$_NO_PRIV:
X$  WRITE SYS$OUTPUT "Insufficient privileges; requires OPER privilege."
X$  GOTO _EXIT
X$
X$_HELP:
X$  TYPE SYS$INPUT:
X
X  USER_JOB_REMOVE
X `20
X     Remove jobs from a printer queue, with options to Requeue to another
X     printer, or Delete jobs (with Email notification, printed report, or
X     no notification).
X         `20
X  Usage: `20
X       $ @USER_JOB_REMOVE `5Bqueue-name`5D
X
X     If the queue-name is omitted, the queue NO_PRINT will be used.
X
X$ `20
X$  GOTO _EXIT
$ CALL UNPACK USER_JOB_REMOVE.COM;87 1270527328
$ v=f$verify(v)
$ EXIT

