Subflows in DataStage
Subflows help you to simplify your design but, unlike local subflows, they are reusable by other data flows.
You can use subflows to make common data flow components available throughout the project. You can create a subflow from scratch, or place a set of existing stages and links within a subflow. When you insert a subflow into a data flow, IBM® DataStage® places an instance of that subflow into the design. When you compile the job containing an instance of a subflow, the code for the subflow is included in the compiled data flow. If you change the contents of a subflow, you will need to recompile those jobs that use the subflow in order for the changes to take effect.
Creating a subflow
To create a subflow:
- Press Shift while you click each stage that you want included, and then right-click in the white space.
- Click Create local subflow. The group is replaced by a local subflow stage.
- Right-click the new local subflow, then select Create subflow.
- Enter a name and click Create. The local subflow stage is replaced by a subflow stage.
- Right-click on the local subflow and select Convert to subflow.
- Enter a name and select Create.
Using a subflow in a data flow
You can insert a subflow into a data flow design by dragging the asset browser from the Connectors section of the palette to the DataStage design canvas, then browsing for a subflow. You can replace a subflow by opening it, clicking the Replace icon , and selecting another subflow.
Creating a DataStage subflow component
You can create a subflow as a reusable component to use in DataStage flows.
- Open an existing project or create a project.
- Click New Asset + and select Create reusable DataStage components.
- Select Subflow as your component type.
You can manage all your DataStage components from the Assets tab.