2.248 WAITFILEEVENT

Valid for

Extract, Replicat

Description

Use WAITFILEEVENT to wait for a specific event before proceeding. Bi-directional scenarios in particular may need to wait for an external event before proceeding.

For example, a file called SOURCE.FLTODAY is mapped to a file called TARGET.FLTODAY. Every day at 17:00, SOURCE.FLTODAY is renamed to SOURCE.FLyymmdd. To propagate the data from SOURCE.FLTODAY to the appropriate target file, a WAITFILEEVENT command is used.

With WAITFILEEVENT, Replicat delays upon receiving information that SOURCE.FLTODAY has been created, until TARGET.FLTODAY is also created.

WAITFILEEVENT produces event messages (which also appear in the Replicat report file) regarding Replicat status while waiting. To bypass the wait event, issue the GGSCI command: SEND REPLICAT group_name, BYPASSFILEEVENT

To use WAITFILEEVENT, the source file must be specified in a corresponding MAP.

Syntax

WAITFILEEVENT source_filespec
[, CREATES]
[, CREATIONWINDOW unit num_units]
[, EXEC "command"]
[, PURGES]
[, RENAMES]
[, WARNAFTER unit warn_time]
source_filespec

The file name or wildcard name to which the wait rules apply.

CREATES

Wait until source_filespec exists. If source_filespec does not exist in the CREATIONWINDOW time period, Replicat keeps checking every 10 seconds until the file has been created.

You must specify one or more CREATES to indicate the events on which to wait.

CREATIONWINDOW unit num_units

The amount of time Replicat checks for the new file.

  • unit can be SECONDS, MINUTES, HOURS; for example CREATIONWINDOW HOURS.

  • num_units can be any positive integer.

The default is CREATIONWINDOW HOURS 20.

EXEC "command"

Execute any valid TACL command or program instead of processing the specified CREATES, PURGES, RENAMES, or some other event. The success of the command is not evaluated. If error handling is necessary, implement it within the command or program being executed.

When you specify EXEC, CREATIONWINDOW and WARNAFTER have no effect.

PURGES

Wait until source_filespec does not exist.

You must specify one or more of PURGES to indicate the events on which to wait.

RENAMES

Wait until source_filespec is renamed. If source_filespec has not been renamed in the CREATIONWINDOW time period, Replicat keeps checking every 10 seconds until the file has been renamed.

You must specify one or more RENAMES to indicate the events on which to wait.

WARNAFTER unit warn_time

The amount of time before a critical event is issued to EMS indicating that the event has not been satisfied.

  • unit can be SECONDS, MINUTES, HOURS; for example WARNAFTER HOURS.

  • warn_time can be any positive integer.

Examples

Example 1   

The following example demonstrates the use of CREATIONWINDOW, WARNAFTER, CREATES, and RENAMES.

WAITFILEEVENT \GGS.$DATA1.DAT.ACCOUNT*, &
CREATIONWINDOW HOURS 5, &
WARNAFTER MINUTES 30, &
CREATES, RENAMES
Example 2   

The following example uses the EXEC option to rename a target file after the source has been purged.

WAITFILEEVENT $data1.dat.account, PURGE, &
EXEC "rename $data2.target.account, &
$data2.targold.account"