If the file is detected and the size remains static within the time frame (CREATE) or the file has been deleted (DELETE), the DO commands in the THEN block are executed. If the file is not detected/deleted within the time frame, the statements following the ELSE block are executed.
CTMFW terminates when either all the files in the Rules file have been processed or a DO_OK/DO-NOTOK action is executed. If any ON_FILEWATCH statement contains a cyclic_interval, CTMFW only terminates on a DO_OK/DO-NOTOK action.
EXAMPLE: CTMFW detects the creation of the specified file, prerequisite condition DATAFILE with an ODAT of 0101 is added, and the created file is moved to the DAILYBK3 subvolume. Otherwise, the same condition is deleted and a file with the same name is created with a record length of 132. If CTMFW detects the deletion of the specified file, the same prerequisite condition is deleted.
#******************************************************************
INTERVAL 10
WAIT_TIME 1
ON_FILEWATCH $DATA02.DAILYBK.DATAFILE CREATE
THEN
DO_COND DATAFILE 0101 +
DO_CMD FUP RENAME DAILYBK.DATAFILE, DAILYBK3.DATAFILE, PURGE
ELSE
DO_COND DATAFILE 0101 -
DO_CMD FUP CREATE DAILYBK3.DATAFILE, REC 132
END_ON
ON_FILEWATCH $DATA02.FTPLIB.TEMPFILE DELETE
THEN
DO_COND TEMPFILE 0101 -
END_ON
#*******************************************************************
Parent Topic |