Filewatcher in Windows panel vs Filewatcher for AFT panel

Everything about Control-M Server installation or setup.
Post Reply
User avatar
sharonc
Nouveau
Nouveau
Posts: 27
Joined: 22 Sep 2006 12:00

Filewatcher in Windows panel vs Filewatcher for AFT panel

Post by sharonc » 06 Aug 2010 8:00

Hi,
Does anyone know whether there is a filename varibale for the windows filewatcher that we can set, to use for the next job?

For example, the AFT module has the option to use autoedit variable for the detected filename.
But, for Windows, I don't see that option.

Thanks.
regards
Sharon

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 06 Aug 2010 9:15

Sharonc,

The filewatcher tab you can use to define a filewatcher job is designed to run a single_action filewatcher against a single (exact or generic) file name.
If you want to retrieve the file name, you must use a filewatcher rule, then run the file watcher using the following format:

ctmfw -input <rule_name>

In that case, the actual file name is accessible within the rule in the %FILENAME% variable.
You can then, as part of the rule, set a global autoedit variable, using a DO_CMD statement.

Example:
ON_FILEWATCH D:\IOALIBS\ctmecs\batch\file_watcher\MSbatch\testfile.txt* CREATE
THEN
DO_CMD ctmvar -action set -var "%%\CTMFW_FILENAME" -VAREXPR "%FILENAME%"
END_ON

I believe this syntax is valid for all platforms. It has been tested on Windows.

Cheers

User avatar
sharonc
Nouveau
Nouveau
Posts: 27
Joined: 22 Sep 2006 12:00

Post by sharonc » 09 Aug 2010 12:13

Thanks for the suggestion. I'll give that a try.

Post Reply