Page 1 of 1

Assign global variable from job Command: using ctmvar

Posted: 29 Jul 2014 4:12
by Kenton
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.

Re: Assign global variable from job Command: using ctmvar

Posted: 29 Jul 2014 6:25
by Kenton
In addition, the "abc123" is actually the result from piped grep and cut statements

Re: Assign global variable from job Command: using ctmvar

Posted: 30 Jul 2014 11:22
by fyot
Hi

As you can see

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

CTMERR is because your variable is unresolved.

Try reading this post

Re: Assign global variable from job Command: using ctmvar

Posted: 31 Jul 2014 4:03
by Kenton
Thanks ... I was missing the #