3 Replies Latest reply on Jul 9, 2010 3:34 PM by Ashok Vaidya

    Control-M filewatch variable question.


      What I want to do is to pass the variable %filename% to the job that is raised by the condition on a filewatch rule file.  So, my rule file will contain wildcards and watch everything in the directory.  Subsequently when the condition is raised after the file is found, I want to have my job call a command such as mycommand.exe %filename%.  This would be the file found by the filewatch utility.  Does anyone know how to accomplish this?  I do not want to use the DO_CMD argument to call my executable.  We want a job to fire so it can be remotely monitored.  Any thoughts?





        • 1. Re: Control-M filewatch variable question.

          use do_cmd to setvar ( to set a variable )


          use that variable as a parm to job that is neing kicked of..


          simple enought but i do't think i said it clearly. please contact me for further explanation,

          • 2. Re: Control-M filewatch variable question.



            The issue with global variables is they would be overridden the next time a file arrives. That variable is global in nature.  I can't guarantee that my Control-M job will finish before receiving the next file.  Do you have any solution for that? 





            • 3. Re: Control-M filewatch variable question.

              you only need the global variable to hold the value for few seconds. once

              the job is executing, it is ok to have the parameter value chnaged.


              are you spawning new jobs or plan to use same job over and over.


              you may also try using init , fw and process job flow.


              init will satify the condition for the first time


              everyitme a file is found file watcher will exit and delete it's in condition and pass a condition to processing job.


              processing job than will completed and create teh same condition a init to allow fw to run again.


              fw will not run when processing job is running.


              ( both jobs will be cyclic. deleteing their own in coditions when end. )



              are you able to capture the filename in the fw input script.. i kinda of know it's possible but have not used it yet.



              Ashok Vaidya