Build tab (DataStage)

Use these sections to define the actual operation that the stage will perform.

Interfaces

Use the Interfaces section to specify details about inputs to and outputs from the stage, and about automatic transfer of records from input to output. You specify port details, a port being where a link connects to the stage. You need a port for each possible input link to the stage, and a port for each possible output link from the stage.

Input

  • Port Name. Optional name for the port. The default names for the ports are in0, in1, in2 ... . You can refer to them in the code using either the default name or the name you have specified.
  • Alias. Where the port name contains non-ascii characters, you can give it an alias in this column (this is only available where NLS is enabled).
  • AutoRead. This defaults to True which means the stage will automatically read records from the port. Otherwise you explicitly control read operations in the code.
  • Table Name. Specify a table definition in the IBM® DataStage® Repository which describes the meta data for the port. You can browse for a table definition by choosing Select Table from the menu that appears when you click the browse button. You can also view the schema corresponding to this table definition by choosing View Schema from the same menu. You do not have to supply a Table Name. If any of the columns in your table definition have names that contain non-ascii characters, you should choose Column Aliases from the menu. The Build Column Aliases dialog box appears. This lists the columns that require an alias and let you specify one.
  • RCP. Choose True if runtime column propagation is allowed for inputs to this port. Defaults to False. You do not need to set this if you are using the automatic transfer facility.

Output

  • Port Name. Optional name for the port. The default names for the links are out0, out1, out2 ... . You can refer to them in the code using either the default name or the name you have specified.
  • Alias. Where the port name contains non-ascii characters, you can give it an alias in this column.
  • AutoWrite. This defaults to True which means the stage will automatically write records to the port. Otherwise you explicitly control write operations in the code. Once records are written, the code can no longer access them.
  • Table Name. Specify a table definition in the IBM DataStage Repository which describes the meta data for the port. You can browse for a table definition. You do not have to supply a Table Name. A shortcut menu accessed from the browse button offers a choice of Clear Table Name, Select Table, Create Table,View Schema, and Column Aliases. The use of these is as described for the Input sub-tab.
  • RCP. Choose True if runtime column propagation is allowed for outputs from this port. Defaults to False. You do not need to set this if you are using the automatic transfer facility.

Transfer

The Transfer section allows you to connect an input buffer to an output buffer such that records will be automatically transferred from input to output. You can also disable automatic transfer, in which case you have to explicitly transfer data in the code. Transferred data sits in an output buffer and can still be accessed and altered by the code until it is actually written to the port.

  • Input. Select the input port to connect to the buffer from the drop-down list. If you have specified an alias, this will be displayed here. You must specify an input port.
  • Output. Select the output port to transfer input records from the output buffer to from the drop-down list. If you have specified an alias, this will be displayed here. The output port is optional.
  • Auto Transfer. This defaults to False, which means that you have to include code which manages the transfer. Set to True to have the transfer carried out automatically.
  • Separate. This is False by default, which means this transfer will be combined with other transfers to the same port. Set to True to specify that the transfer should be separate from other transfers.

Logic

Specify the actual code that the stage executes.

Definitions

Specify variables, include header files, and otherwise initialize the stage before processing any records.

Pre-loop

Specify code which is executed at the beginning of the stage, before any records are processed.

Per-record

Specify the code which is executed once for every record processed.

Post-loop

Specify code that is executed after all the records have been processed.

You can type straight into these sections or cut and paste from another editor. The shortcut menu in the Pre-Loop, Per-Record, and Post-Loop sections gives access to the macros that are available for use in the code.