0 / 0

Switch stage in DataStage

Last updated: Mar 12, 2025
Switch stage in DataStage

The Switch stage takes a single data set as input and assigns each input row to an output data set based on the value of a selector field.

The Switch stage can have a single input link, up to 128 output links, and a single rejects link.

The Switch stage is a processing stage. It performs an operation analogous to a C switch statement, which causes the flow of control in a C program to branch to one of several cases based on the value of a selector variable. Rows that satisfy none of the cases are output on the rejects link.

When you double click the Switch stage, the properties panel opens. The properties panel has three tabs:

  • Stage. This is always present and is used to specify general information about the stage.
  • Input. This is where you specify the details about the single input set from which you are selecting rows.
  • Output. This is where you specify details about the processed data being output from the stage.

Input tab

The Columns section specifies the column definitions of incoming data. The Advanced section allows you to change the default buffering settings for the input link.

Output tab

The Switch stage can have up to 128 output links, and can also have a reject link carrying rows that have been rejected. Choose the link you are working on from the Output name drop-down list.

The Columns section specifies the column definitions of the data. Click Edit in the columns section to open the column editor. The Maps from input column section allows you to specify the relationship between the columns being input to the Switch stage and the Output columns. The Advanced section allows you to change the default buffering settings for the output links.