WAIT JOURNALNAME

Synchronize the task with journal output being written to a system logger log stream.

WAIT JOURNALNAME

Read syntax diagramSkip visual syntax diagramWAIT JOURNALNAME( data-value)REQID( data-value)

Conditions: IOERR, JIDERR, NOTOPEN

This command is threadsafe.

 

Description

WAIT JOURNALNAME synchronizes the task with the output of one or more journal records that have been created but whose output has been deferred; that is, with asynchronous journal output requests.

The journal records may already be written out from the journal buffer area to the corresponding system logger log stream, or the system logger output operation may be in progress. If the log stream output operation has already been completed, control returns immediately to the requesting task; if not, the requesting task waits until the operation has been completed.

If the requesting program has made a succession of successful asynchronous output requests to the same journal, it is necessary to synchronize on only the last of these requests to ensure that all of the journal records have been output to the system logger log stream. This may be done either by issuing a stand-alone WAIT JOURNALNAME command, or by making the last output command itself synchronous (by specifying the WAIT option in the WRITE JOURNALNAME command).

Options

JOURNALNAME(data-value)
specifies a 1– to 8– character journal name identifying the journal on which the task is to wait for synchronization. The name must be a journal name known to CICS®.

To issue the wait against the CICS system log, specify DFHLOG as the journal name.

To issue the wait against journals defined using the journal numbering convention, as in file resource definitions, specify the name as DFHJnn, where nn is the journal number in the range 1 to 99.

Note: Specifying DFHJ01 on this command refers to a user journal, not the system log.
REQID(data-value)
specifies, in a fullword binary variable, the token that refers to a journal record that has been created but possibly not yet written out. The token is returned by CICS from a previous WRITE JOURNALNAME command issued by this task.

If you do not specify REQID, the task is synchronized with the output of the current buffer for the journal specified by JOURNALNAME.

Conditions

17 IOERR
a journal record was not output because of an irrecoverable error condition returned by the system logger or by SMF.

Default action: If the log is the system log, CICS either quiesces or abends. If it is a general log, the task is terminated abnormally.

43 JIDERR
occurs in either of the following situations:
  • The specified journal name is not known in the CICS region.
  • The specified journal name refers to a DASD-only log stream to which a CICS region in another MVS™ image is currently connected.

Default action: terminate the task abnormally.

19 NOTOPEN
occurs in any of the following situations:
  • The command cannot be satisfied because the user explicitly disabled the specified journal.
  • A wait request is issued against a journal that has not previously been written to.
  • This journal was defined using a model that maps it into the logstream used by the system log for this system. This error is not detected when trying to connect to the logstream. A definition for the journal will be installed and set to failed.

Default action: terminate the task abnormally.

70 NOTAUTH
A resource security check has failed on the JOURNALNAME (data-value).

Default action: terminate the task abnormally.

Examples

The following example shows how to request synchronization with the output of journal records written to a user journal named 'ACCOUNTS'
EXEC CICS WAIT JOURNALNAME('ACCOUNTS')
     REQID(RECTOKEN)