0 / 0
Switch stage: Stage tab (DataStage)

Switch stage: Stage tab (DataStage)

You can specify aspects of the Switch stage on the Stage tab.

The Properties section lets you specify what the stage does. The Advanced section allows you to specify how the stage executes. The Link Ordering section allows you to specify what order the output links are processed in.

Properties

You can specify the following properties:
Table 1. Properties
Category/Property Values Default Mandatory? Repeats? Dependent of
Input/Selector Input Column N/A Y N N/A
Input/Additional properties/Case Sensitive True/False True N N Selector
Input/Selector Mode User-defined mapping/Auto/Hash User-defined mapping Y N N/A
User-defined Mapping/Case String N/A Y (if Selector Mode = User-defined mapping) Y N/A
Options/If not found Pathname N/A Y (if Column Method = Schema file) N N/A
Input/Additional properties/Discard Value String N/A N N N/A

Selector

Specifies the input column that the switch applies to.

Case sensitive

Specifies whether the column is case sensitive or not.

Selector mode

Specifies how you are going to define the case statements for the switch. Choose between:

  • User-defined Mapping. This is the default, and means that you must provide explicit mappings from case values to outputs. If you use this mode you specify the switch expression under the User-defined Mapping category.
  • Auto. This can be used where there are as many distinct selector values as there are output links.
  • Hash. The incoming rows are hashed on the selector column modulo the number of output links and assigned to an output link accordingly.

Case

This property appears if you have chosen a Selector Mode of User-defined Mapping. Specify the case expressions in the case property. Each case expression has the following format:


Selector_Value[= Output_Link_Label_Number]

You must specify a selector value for each value of the input column that you want to direct to an output column. You can specify multiple mappings in the case expression. You can omit the output link label if the value is intended for the same output link as the case previously specified. For example, the case statements:


1990=0
1991
1992
1993=1
1994=1

would cause the rows containing the dates 1990, 1991, or 1992 in the selector column to be routed to output link 0, and the rows containing the dates 1993 to 1994 to be routed to output link 1.

If not found

Specifies the action to take if a row fails to match any of the case statements. This does not appear if you choose a Selector Mode of Hash. Otherwise, choose between:

  • Fail. Causes the job to fail.
  • Drop. Drops the row.
  • Output. Routes the row to the Reject link.

Discard value

You can use this property in conjunction with the case property to specify that rows containing certain values in the selector column will always be discarded. For example, if you defined the following case statement:


1995=5

and set the Discard Value property to 5, all rows containing 1995 in the selector column would be routed to link 5 which has been specified as the discard link and so will be dropped.

Advanced

This section allows you to specify the following:

  • Execution Mode. The stage can execute in parallel mode or sequential mode. In parallel mode the input data is processed by the available nodes as specified in the Configuration file, and by any node constraints specified on the Advanced section. In Sequential mode the entire data set is processed by the conductor node.
  • Combinability mode. This is Auto by default, which allows IBM® DataStage® to combine the operators that underlie parallel stages so that they run in the same process if it is sensible for this type of stage.
  • Preserve partitioning. This is Set by default. You can explicitly select Set or Clear. Select Set to request the next stage should attempt to maintain the partitioning.
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more