Both plans and components may declare variables for use by their steps. Component variables are evaluated and bound at the time the component is installed. Therefore, if a step within a component control block references a component-scoped variable, the value used will be the value of that variable at the time the component was installed. Plan variables are evaluated and bound each time the plan is run. Therefore, if a step within a plan references a plan variable, the value used will be the value defined at the time of the plan run, and may vary from one run to another.
A plan may declare both parameters and variables. The value of a variable is defined at the point of declaration based on the values of other variables and constants. A parameter is a special kind of variable whose value is defined by the caller. In the case of a top-level plan, the caller is the user who initiates the plan run. For each parameter declared by the plan, the user enters the desired value for that parameter prior to running the plan. When a plan is invoked as the result of an <execSubplan> call, the plan containing the <execSubplan> call is responsible for explicitly passing values for each of the parameters declared by the called plan.
It is also possible for install, uninstall, snapshot, and control blocks to declare parameters and local variables. As with plans, local variable values are locally defined, and parameter values are defined based on the values passed by the caller of the block. Both may vary each time a plan is run.
There are no facilities for re-assigning the value of a variable or parameter.