Control-M File Watcher Utility

Everything about Control-M Control Modules
Post Reply
User avatar
Joerg
Nouveau
Nouveau
Posts: 8
Joined: 18 Apr 2007 12:00
Location: Erding, Germany

Control-M File Watcher Utility

Post by Joerg » 03 Jul 2007 1:36

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?

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 03 Jul 2007 5:32

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

User avatar
Joerg
Nouveau
Nouveau
Posts: 8
Joined: 18 Apr 2007 12:00
Location: Erding, Germany

Post by Joerg » 12 Jul 2007 5:50

I have used a UNIX variable which did the job fine.

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 24 Jul 2007 10:22

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.

Post Reply