[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP OpenVMS DCL Dictionary


Previous Contents Index


SYNCHRONIZE

Holds the process issuing the command until the specified job completes execution.

Requires delete (D) access to the specified job.


Format

SYNCHRONIZE [job-name]


Parameter

job-name

Specifies the name of the job as defined when the job was submitted. You can specify only job names that are associated with your user name. (A job is associated with the user name of the process that submits it.)

To specify a job that does not have a unique name, use the /ENTRY qualifier to specify the entry number. If you specify both the job-name parameter and the /ENTRY qualifier, the job-name parameter is ignored.

If you specify the job-name parameter, the command searches for a job with the specified name in the queue SYS$BATCH. To specify a job in a different queue, you must specify the name of the queue using the /QUEUE qualifier.


Description

The SYNCHRONIZE command provides job synchronization by placing a process in a wait state until the specified job completes. If the specified job is not a current job in the system, the SYNCHRONIZE command displays an error message.

When a job specified in a SYNCHRONIZE command completes, the process is released from the wait state. The completion status for the SYNCHRONIZE command is the same as the completion status of the last command executed in the job. To make sure that you can determine the completion status when the SYNCHRONIZE command is part of a command procedure, include SET NOON before the SYNCHRONIZE command and SHOW SYMBOL $STATUS immediately after the SYNCHRONIZE command.

You must specify either the job-name parameter or the /ENTRY qualifier.


Qualifiers

/ENTRY=entry-number

Identifies the job by the system-assigned entry number.

The system assigns a unique entry number to each queued print or batch job in the system. By default, the PRINT and SUBMIT commands display the entry number when they successfully queue a job for processing. These commands also create or update the local symbol $ENTRY to reflect the entry number of the most recently queued job. To find a job's entry number, enter the SHOW ENTRY or SHOW QUEUE command. If you specify both the job-name parameter and the /ENTRY qualifier, the job name is ignored.

/QUEUE=queue-name[:]

Names the queue containing the job. If you use the /QUEUE qualifier, you must specify either the job-name parameter or the /ENTRY qualifier. If you specify the job-name parameter, the default queue is SYS$BATCH. If you specify the /ENTRY qualifier, there is no default queue. If you specify a generic queue, the command looks for the job in the generic queue and in the qeneric queue's target execution queues.

/TIME_OUT=n

Allows the user to specify the number of seconds to wait before terminating the SYNCHRONIZE command when the target job is running.

Examples

#1

$ SUBMIT/NAME=PREP FORMAT/PARAMETERS=(SORT,PURGE)
  Job PREP (queue SYS$BATCH, entry 219) started on queue SYS$BATCH
$ SUBMIT PHASER
  Job PHASER (queue SYS$BATCH, entry 223) started on queue SYS$BATCH
      

In this example, the first SUBMIT command submits the command procedure FORMAT.COM for execution and names the job PREP. The second SUBMIT command queues the procedure PHASER.COM. The procedure PHASER.COM contains the following line:


$ SYNCHRONIZE PREP

When this line is processed, the system verifies whether the job named PREP exists in the default queue SYS$BATCH. The procedure PHASER is forced to wait until the job PREP completes execution.

#2

$ SUBMIT/NAME=TIMER       COMP.COM
  Job TIMER (queue SYS$BATCH, entry 214) started on queue SYS$BATCH
$ SYNCHRONIZE /ENTRY=214
      

In this example, a batch job named TIMER is submitted. Then the SYNCHRONIZE command is entered interactively. This command places the interactive process in a wait state until entry number 214 (TIMER) completes. You cannot enter subsequent commands from your terminal session until the SYNCHRONIZE command completes and your process is released from the wait state.

#3

$ SUBMIT/NAME=TIMER COMP.COM/QUEUE=BUILD_QUEUE
$ SYNCHRONIZE/QUEUE=BUILD_QUEUE TIMER
      

The batch job name TIMER is submitted to the queue BUILD_QUEUE in this example. Then the SYNCHRONIZE command is entered interactively. Because the job named TIMER is not in the default queue SYS$BATCH, the SYNCHRONIZE command includes the /QUEUE qualifier to specify the queue in which the job is located.


Previous Next Contents Index