Setting variable from job with CTMVAR

All questions about Control-M jobs definitions
Post Reply
User avatar
DocGoo
Nouveau
Nouveau
Posts: 73
Joined: 08 Sep 2010 12:00

Setting variable from job with CTMVAR

Post by DocGoo » 19 Feb 2013 10:32

Hello,

I am trying to set a variable in my job that is called from CTM. I use these lines of PS, but could really be in any lang.

$exe = "F:\Program Files\BMC Software\CONTROL-M Server\Ctm-server\ctmvar.exe"

&$exe -action set -var "%%\PARM44" -varexpr "UP"


This should call CTMVAR and set its value to "UP". I then use this variable in the body of an DO EMAIL sent by CTM.

I do pass %%PARM44 into my script as an arg.

Any ideas ????????????????

--Goo

User avatar
DocGoo
Nouveau
Nouveau
Posts: 73
Joined: 08 Sep 2010 12:00

Post by DocGoo » 20 Feb 2013 3:28

I have answered my question on my own last night.

$exe = "F:\Program Files\BMC Software\CONTROL-M Server\Ctm_server\Exe\ctmvar.exe"

&$exe -action set -var "%%\PARM46" -varexpr "DOWN"


This example is in Powershell but could be easily done in DOS too.

Now I can set varibles to any value (<4000 char) and pass back to CTM and use, in my case as a dynamicaly built email body with specific information from my job script. Such as rows, columns, errors, etc.

--Goo

Post Reply