Use wsadmin to manage substitution variables

You can use wsadmin to configure a variable map for your application server. You can configure multiple variable maps, but they are all stored in the variables.xml file.

To configure a variable map for your application server, follow these steps:

    On the CL command line, run the STRQSH (Start Qshell) command.

    Run the cd command to change to the directory that contains wsadmin:

    cd /QIBM/ProdData/WebASE51/ASE/bin

    Start wsadmin.

    At the wsadmin prompt, run this command to identify the server and assign it to the server variable:

    set server [$AdminConfig getid /Cell:myCell/Node:myNode/Server:myAppSvr/]

    where myCell is the name of the cell that contains your application server, myNode is the name of the node that contains your application server, and myAppSvr is the name of your application server.

    Create an empty variable map or identify an existing variable map for the application server. Assign the variable map to the varMap variable.

      To create an empty variable map for the server and assign it to the varMap variable, run this command:

      set varMap [$AdminConfig create VariableMap $server {}]

      If your server has an existing variable map, run this command to get its configuration object and assign it to the varMap variable:

      set varMap [$AdminConfig getid /Cell:myCell/Node:myNode/Server:myAppSvr/VariableMap:/]

      where myCell is the name of the cell that contains your application server, myNode is the name of the node that contains your application server, and myAppSvr is the name of your application server.

    Set the variable map entry attributes. In this example, you create variable map entries APPLICATION_SPECIFIC_ROOT and APPLICATION_SPECIFIC_LIB_DIR.

    set nameattr1 [list symbolicName APPLICATION_SPECIFIC_ROOT]
      set valattr1 [list value "application/specific/root"]
      set nameattr2 [list symbolicName APPLICATION_SPECIFIC_LIB_DIR]
      set valattr2 [list value "/${APPLICATION_SPECIFIC_ROOT}/lib"]
      set attr1 [list $nameattr1 $valattr1]
      set attr2 [list $nameattr2 $valattr2]
      set attrs [list $attr1 $attr2]

    These commands return this output:

    {{symbolicName APPLICATION_SPECIFIC_ROOT} {value application/specific/root}}
     {{symbolicName APPLICATION_SPECIFIC_LIB_DIR} {value {${APPLICATION_SPECIFIC_ROOT}/lib}}}

    To add the two new entries, run this command to modify the entries attribute in the variable map:

    $AdminConfig modify $varMap [subst {{entries {$attrs}}}]

    Run this command to save your changes:

    $AdminConfig save

    If you want to view the variable map, run this command:

    $AdminConfig showall $varMap

    The command returns this output:

    {entries {{{symbolicName APPLICATION_SPECIFIC_ROOT}
     {value application/specific/root}} {{symbolicName APPLICATION_SPECIFIC_LIB_DIR}
     {value ${APPLICATION_SPECIFIC_ROOT}/lib}}}}