Topic
  • 4 replies
  • Latest Post - ‏2005-11-17T10:02:22Z by SystemAdmin
SystemAdmin
SystemAdmin
37422 Posts

Pinned topic Using numeric variables with jacl

‏2005-07-22T09:13:08Z |
Inside my jacl script I want to use a variable for an integer value, i.e. this works fine:

>$AdminConfig modify $module1 {{startingWeight 5000}}

this does not work:

>set weight 5000
>$AdminConfig modify $module1 {{startingWeight $weight}}
I get the following error:

com.ibm.ws.scripting.ScriptingException: WASX7088E: Invalid numeric value specified for attribute "startingWeight"
I tried a lot of different things and can't find an example of anybody doing this. I use Websphere 5.0.2 fixpack 1.

Peter.
Updated on 2005-11-17T10:02:22Z at 2005-11-17T10:02:22Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Using numeric variables with jacl

    ‏2005-07-27T15:50:27Z  
    Try something like this

    set weight expr5000+0

    <peter.reinhardt@bnpparibas.com> wrote in message
    news:1637618754.1122023643658.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
    > Inside my jacl script I want to use a variable for an integer value, i.e.
    this works fine:
    >
    > >$AdminConfig modify $module1 {{startingWeight 5000}}
    >
    > this does not work:
    >
    > >set weight 5000
    > >$AdminConfig modify $module1 {{startingWeight $weight}}
    >
    >
    > I get the following error:
    >
    > com.ibm.ws.scripting.ScriptingException: WASX7088E: Invalid numeric value
    specified for attribute "startingWeight"
    >
    >
    > I tried a lot of different things and can't find an example of anybody
    doing this. I use Websphere 5.0.2 fixpack 1.
    >
    > Peter.
    >

  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Using numeric variables with jacl

    ‏2005-11-14T14:56:43Z  
    Try something like this

    set weight expr5000+0

    <peter.reinhardt@bnpparibas.com> wrote in message
    news:1637618754.1122023643658.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
    > Inside my jacl script I want to use a variable for an integer value, i.e.
    this works fine:
    >
    > >$AdminConfig modify $module1 {{startingWeight 5000}}
    >
    > this does not work:
    >
    > >set weight 5000
    > >$AdminConfig modify $module1 {{startingWeight $weight}}
    >
    >
    > I get the following error:
    >
    > com.ibm.ws.scripting.ScriptingException: WASX7088E: Invalid numeric value
    specified for attribute "startingWeight"
    >
    >
    > I tried a lot of different things and can't find an example of anybody
    doing this. I use Websphere 5.0.2 fixpack 1.
    >
    > Peter.
    >

    I've got the same problem while setting an endpoint port. The port number ist read from a file:

    1. read properties from config file (key=value)
    set f
    while {gets $f line != -1} {
    if {! && !} {
    set key [lindex split $line =] 0
    set value [lindex split $line =] 1
    set $key $value
    }
    }
    close $f

    ... and then use the variable $port to create an endpoint:

    $AdminConfig create NamedEndPoint $server {{endPointName "ORB_LISTENER_PORT"} {endPoint {{host localhost} {port $port}}}}

    The error message is:
    WASX7017E: Exception received while running file "install.jacl"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7088E: Invalid numeric value specified for attribute "port"
    I tried the suggested way from the previous post, but that didn't work:


    set newPort expr $port+0


    ... returns the same error message.

    Do you know any workaround?
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Using numeric variables with jacl

    ‏2005-11-14T17:40:19Z  
    I've got the same problem while setting an endpoint port. The port number ist read from a file:

    1. read properties from config file (key=value)
    set f
    while {gets $f line != -1} {
    if {! && !} {
    set key [lindex split $line =] 0
    set value [lindex split $line =] 1
    set $key $value
    }
    }
    close $f

    ... and then use the variable $port to create an endpoint:

    $AdminConfig create NamedEndPoint $server {{endPointName "ORB_LISTENER_PORT"} {endPoint {{host localhost} {port $port}}}}

    The error message is:
    WASX7017E: Exception received while running file "install.jacl"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7088E: Invalid numeric value specified for attribute "port"
    I tried the suggested way from the previous post, but that didn't work:


    set newPort expr $port+0


    ... returns the same error message.

    Do you know any workaround?
    {}'s surround a list in which variable substitution takes place, so you need to use the list command to construct the list dynamically:
    $AdminConfig modify $module1 [list list startingWeight $weight]
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Using numeric variables with jacl

    ‏2005-11-17T10:02:22Z  
    {}'s surround a list in which variable substitution takes place, so you need to use the list command to construct the list dynamically:
    $AdminConfig modify $module1 [list list startingWeight $weight]
    That worked.
    Thanks!