You can specify the horizontal pivot operation and then
map the resulting columns onto output columns.
Use horizontal pivot operations to map rows into output
columns.
- Design your DataStage® flow:
- Drag a Pivot Enterprise stage onto the canvas.
- Place the stage that will supply the input data on the canvas on the left of the Pivot
Enterprise stage.
- Place the stage that is the target for the output data on the canvas on the right of
the Pivot Enterprise stage.
- Link the three stages together.
- Configure the stage that provides the input data.
- Open the Pivot Enterprise stage, then open the Properties section
on the Stage tab.
- Specify the Pivot type as
Horizontal.
- Click Edit in the Pivot Properties
section.
- Specify the horizontal pivot operation on the Horizontal pivot
page.
- Click Add column +.
- In the Column name field, type the name of the output column
that will contain the pivoted data (the pivot column).
- Specify the SQL type and, if necessary (for example if the SQL type is decimal), the
length and scale for the pivoted data.
- Select the columns that you want to combine in the pivot column by using the drop-down
list of available columns under Derivation.
- Click Apply.
- If you want the stage to number the pivoted rows by generating a pivot index column,
select Pivot index.
- Specify your output data by doing the following tasks:
- Click the Output tab.
- Open the Columns section, then click
Edit by the Columns table.
- Select all the columns that you want to appear in your output data, then click
Apply and return.
- Click the Columns tab to view the data that the stage will
output when the job runs.
- Click Save to save your pivot operation and close the Pivot
Enterprise stage.