cmtvar action for multiple variables using input file

All questions about Control-M jobs definitions
Post Reply
User avatar
bwcarr
Nouveau
Nouveau
Posts: 8
Joined: 29 Jul 2010 12:00

cmtvar action for multiple variables using input file

Post by bwcarr » 09 Sep 2010 1:26

I have a series of control-m jobs that delete global variables from the system using the ctmvar utility (ctmvar -action delete -var xxxxxx) from the job command line.

I was looking at streamlining the process by using a text input file with the ctmvar command to specify delete actions on multiple variables. What I have found is that the ctmvar utility reads input file, however, it appears to only perfrom the delete action for the last variable specified in the file.

I have used the following syntax in the text file :

-action delete
-var "%%#\temp_Var_1"
-action delete
-var "%%#\temp_VAR_2"
-action delete
-var "%%#\temp_VAR_3"
-action delete
-var "%%#\temp_VAR_4"

So when I run the control-M job, the ctmvar utility on the command line references the input file with the above lines specified.

The control-M job only deletes the last variable from the system.

Question: Can the input file specify more than one variable to be acted upon?

Question: If so, what changes do I need to make to make it work?

Is there any other way to perform multiple actions on variables with the use of one control-M job rather than having to run many jobs to achieve the same result (eg. Write a script)?

Thanks

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

Post by nicolas_mulot » 09 Sep 2010 8:41

bwcarr,

I ran same tests and obtain the very same result with ctm640 on windows.

The doc is not very clear about whether you can specify several lines or not.

Regarding the ability to act on several variables in one job, you have the answer already.

If you transform your input file by adding "ctmvar" on every line - after merging actions lines on one single line, E.G. -action delete -var "%%#\temp_Var_1" in your file, you will obtain a single script which you will be able to run as a ctmjob.

Your script only deletes variables.
Adding variables can easily be performed using do_setvar, in a dummy job for example. This provides better visibility on the actions you intend to perform.

cheers
Nicolas Mulot

Post Reply