Enviromental variable as parameter in a job

All questions about Control-M jobs definitions
Post Reply
User avatar
dkaris
Nouveau
Nouveau
Posts: 27
Joined: 10 Nov 2008 12:00

Enviromental variable as parameter in a job

Post by dkaris » 29 Apr 2010 3:27

Hello Group,
We are trying to populate a parameter in Control-M with the value of a user defined enviromental variable.

For example:
I have set in windows a variable "demovar" with value "1234"
I would like to set in Control-M %%testvar = %demovar
and then do an echo %%testvar so as to see 1234 in sysout.

So far in sysout I did not get the needed result. Ay ideas?

Regards
Dimitris

PS: If I try the same example with %PATH% it seems to be working...

LordOfAfford

Post by LordOfAfford » 30 Apr 2010 1:35

Is the environment variable defined for the user you run the job with ?
If your job runs under the defined account it logs onto the specific env variables of that user so check it

User avatar
dkaris
Nouveau
Nouveau
Posts: 27
Joined: 10 Nov 2008 12:00

Post by dkaris » 04 May 2010 1:29

LordOfAfford wrote:Is the environment variable defined for the user you run the job with ?
If your job runs under the defined account it logs onto the specific env variables of that user so check it
Yes it is,
I chekced the variable and still does not work...

baralem

Post by baralem » 04 May 2010 2:44

If ctmserver process was started before you defined the variable I believe that you cannot use it. Yo should restart control-m server after varaible definition.
Have you tried global variables:

[1] % ctmvar
Output:
Parameter -ACTION isn't specified
usage: ctmvar
-ACTION <LOAD>
[ -VAR <Variable> ]
[ -VAREXPR <Variable> ]
[ -FILENAME <Filename> ]
[ -QUIET ]
[ -DEBUG <debug> ]


regards.

User avatar
dkaris
Nouveau
Nouveau
Posts: 27
Joined: 10 Nov 2008 12:00

Post by dkaris » 04 May 2010 3:41

baralem wrote:If ctmserver process was started before you defined the variable I believe that you cannot use it. Yo should restart control-m server after varaible definition.
Have you tried global variables:

[1] % ctmvar
Output:
Parameter -ACTION isn't specified
usage: ctmvar
-ACTION <LOAD>
[ -VAR <Variable> ]
[ -VAREXPR <Variable> ]
[ -FILENAME <Filename> ]
[ -QUIET ]
[ -DEBUG <debug> ]


regards.
Hello,
A re-start seems like a possible solution. I will have to try it tommorow.

CTMVAR might be a solution but I would like to utilize the environmental variables because various applications set their values there...

Post Reply