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
WAITFILEEVENTsource_filespec[, CREATES] [, CREATIONWINDOWunitnum_units] [, EXEC "command"] [, PURGES] [, RENAMES] [, WARNAFTERunitwarn_time]
-
source_filespec -
The file name or wildcard name to which the wait rules apply.
-
CREATES -
Wait until
source_filespecexists. Ifsource_filespecdoes not exist in theCREATIONWINDOWtime period, Replicat keeps checking every 10 seconds until the file has been created.You must specify one or more
CREATESto indicate the events on which to wait. -
CREATIONWINDOWunitnum_units -
The amount of time Replicat checks for the new file.
-
unitcan beSECONDS,MINUTES,HOURS; for exampleCREATIONWINDOW HOURS. -
num_unitscan 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,CREATIONWINDOWandWARNAFTERhave no effect. -
PURGES -
Wait until
source_filespecdoes not exist.You must specify one or more of
PURGESto indicate the events on which to wait. -
RENAMES -
Wait until
source_filespecis renamed. Ifsource_filespechas not been renamed in theCREATIONWINDOWtime period, Replicat keeps checking every 10 seconds until the file has been renamed.You must specify one or more
RENAMESto indicate the events on which to wait. -
WARNAFTERunitwarn_time -
The amount of time before a critical event is issued to EMS indicating that the event has not been satisfied.
-
unitcan beSECONDS,MINUTES,HOURS; for exampleWARNAFTER HOURS. -
warn_timecan be any positive integer.
-
Examples
- Example 1
-
The following example demonstrates the use of
CREATIONWINDOW,WARNAFTER,CREATES, andRENAMES.WAITFILEEVENT \GGS.$DATA1.DAT.ACCOUNT*, & CREATIONWINDOW HOURS 5, & WARNAFTER MINUTES 30, & CREATES, RENAMES
- Example 2
-
The following example uses the
EXECoption to rename a target file after the source has been purged.WAITFILEEVENT $data1.dat.account, PURGE, & EXEC "rename $data2.target.account, & $data2.targold.account"