With the Control-M File Watcher Utility I am trying to move an incoming data file to a new location and a new name. Within this new name I would like to implement a ODATE. i.e.
DO_CMD mv /incoming/TEST.txt /incoming/arch/TEST.%%ODATE.TXT
Unfortunately this does not work as the filewatcher does not recognize the variable.
Does anyone have solution?
Control-M File Watcher Utility
Joerg,
The command:
"DO_CMD mv /incoming/TEST.txt /incoming/arch/TEST.%%ODATE.TXT"
isnt in a controlm job, isnt it?
The variable "%%ODATE" is a controlm variable.
You must pass this variable to the system if you want with %%PARMn variables, or use another local var that have the same value of %%ODATE
The command:
"DO_CMD mv /incoming/TEST.txt /incoming/arch/TEST.%%ODATE.TXT"
isnt in a controlm job, isnt it?
The variable "%%ODATE" is a controlm variable.
You must pass this variable to the system if you want with %%PARMn variables, or use another local var that have the same value of %%ODATE
Fine for unix variable but if you want you can try to pass a controlm variable to the script.
1) in the job that run the script in the set panel:
%%PARM1=%%ODATE
2) In the unix script put a line like:
Date1=$1
($1 is the first parameter passed and correspond to "PARM1")
So the your line become:
DO_CMD mv /incoming/TEST.txt /incoming/arch/TEST.$Date1.TXT
To the variable $Date1 is passed the value of the ODATE that become from controlm.
As you imagine this way can be powerfull and flexible.
1) in the job that run the script in the set panel:
%%PARM1=%%ODATE
2) In the unix script put a line like:
Date1=$1
($1 is the first parameter passed and correspond to "PARM1")
So the your line become:
DO_CMD mv /incoming/TEST.txt /incoming/arch/TEST.$Date1.TXT
To the variable $Date1 is passed the value of the ODATE that become from controlm.
As you imagine this way can be powerfull and flexible.