Assign global variable from job Command: using ctmvar

All questions about Control-M jobs definitions
Post Reply
User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

Assign global variable from job Command: using ctmvar

Post by Kenton » 29 Jul 2014 4:12

Hello

I am trying to run this from an OS job type:

Code: Select all

ctmvar -action set -var "%%\myvar" -varexpr "abc123"
but the job fails and the sysout shows:

Code: Select all

+ ctmvar -action set -var 'CTMERR\myvar' -varexpr abc123
Output:
Var name 'CTMERR\myvar' in -VAR invalid: it must begin with %%
usage: ctmvar
  -ACTION                <LOAD|SET|DELETE|LIST>
  [ -VAR                   <Variable> ]
  [ -VAREXPR               <Variable Expression> ]
  [ -FILENAME              <Filename> ]
  [ -QUIET ]
  [ -DEBUG                 <debug level> ]


Result:    Failure.
What am I doing wrong?
K.

User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

Re: Assign global variable from job Command: using ctmvar

Post by Kenton » 29 Jul 2014 6:25

In addition, the "abc123" is actually the result from piped grep and cut statements

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Re: Assign global variable from job Command: using ctmvar

Post by fyot » 30 Jul 2014 11:22

Hi

As you can see

ctmvar -action set -var 'CTMERR\myvar' -varexpr abc123

CTMERR is because your variable is unresolved.

Try reading this post

User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

Re: Assign global variable from job Command: using ctmvar

Post by Kenton » 31 Jul 2014 4:03

Thanks ... I was missing the #

Post Reply