Operating System - OpenVMS
1748327 Members
3370 Online
108762 Solutions
New Discussion

Re: Submit com proc to batch que to run once a week?

 
Jess Goodman
Esteemed Contributor

Re: Submit com proc to batch que to run once a week?

As to the easiest way to resubmit a batch job exactly as it was submitted before using the new version of the batch command procedure, may I recommend that you use my DISPLAY_JOBS.COM for this task.

As documented in the help text output with
$ @DISPLAY_JOBS ?

This one-liner will resubmit batch job entry 123 using a new version of its batch command procedure and kill the old job:
$ PIPE @DISPLAY_JOBS "" 123 * VERSION,KILL /CONF | @SYS$PIPE

Now I realize that is a long line to type, but you can just use a 1 line RESUBMIT.COM that runs the above command using P1 for the entry number.

Personally though I hate using one command procedure as a wrapper for another, so here is another method using some PIPE magic (this requires my newest version - attached to this post). Define a symbol in your LOGIN.COM this way (use the full path for DISPLAY_JOBS.COM):

$ RESUBMIT == "PIPE WRITE SYS$OUTPUT ""PIPE @DISPLAY_JOBS"+-
"+ 'P1' * KILL,VERSION/CONFIRM|@SYS$PIPE:"" | @SYS$PIPE:"

$ SHOW SYMBOL RESUBMIT
RESUBMIT == "PIPE WRITE SYS$OUTPUT "PIPE @DISPLAY_JOBS+ 'P1' * KILL,VERSION/CONFIRM|@SYS$PIPE:" | @SYS$PIPE:"

And then Bob's your uncle:

$ SHOW ENTRY/FULL/USER=SYSTEM CLUSTER_NEW_DAY
Entry Jobname Username Blocks Status
----- ------- -------- ------ ------
1002606 CLUSTER_NEW_DAY SYSTEM Holding until 22-MAY-2008 00:00:00
On idle batch queue ACCTIQ
Submitted 21-MAY-2008 00:00:00 /KEEP /LOG=SLOG:[MAINT].LOG; /NOPRINT
/PRIORITY=255 /RESTART=ACCTIQ
File: _$1$DGA111:[DSKA.SYSCLOCK]CLUSTER_NEW_DAY.COM;3

$ RESUBMIT 1002606
SUBMIT _$1$DGA111:[DSKA.SYSCLOCK]CLUSTER_NEW_DAY.COM;4 ? [N]: Y
Job CLUSTER_NEW_DAY (queue ACCTIQ, entry 158) holding until 22-MAY-2008 00:00
%DELETE-I-DELETED, entry 1002606 aborting or deleted

$ SHOW ENTRY/FULL/USER=SYSTEM CLUSTER_NEW_DAY
Entry Jobname Username Blocks Status
----- ------- -------- ------ ------
158 CLUSTER_NEW_DAY SYSTEM Holding until 22-MAY-2008 00:00:00
On idle batch queue ACCTIQ
Submitted 21-MAY-2008 16:26:12 /KEEP /LOG=$1$DGA115:[SLOG.][MAINT].LOG;
/NOPRINT /PRIORITY=255 /RESTART=ACCTIQ
File: _$1$DGA111:[DSKA.SYSCLOCK]CLUSTER_NEW_DAY.COM;4
I have one, but it's personal.