Defining build stages
Define a Build stage to create a custom operator that can be used in a DataStage® flow.
About this task
The stage will be available to all flows in the project in which the stage was defined. You can make it available to other projects using the IBM® DataStage Export facilities. You can choose whether to add the stage to the design canvas.
When defining a Build stage you provide the following information:
- Description of the data that will be input to the stage.
- Whether records are transferred from input to output. A transfer copies the input record to the output buffer. If you specify auto transfer, the operator transfers the input record to the output record immediately after execution of the per record code. The code can still access data in the output buffer until it is actually written.
- Any definitions and header file information that needs to be included.
- Code that is executed at the beginning of the stage (before any records are processed).
- Code that is executed at the end of the stage (after all records have been processed).
- Code that is executed every time the stage processes a record.
- Compilation and build details for actually building the stage.
Note that the custom operator that your build stage executes must have at least one input data set.
The Code for the Build stage is specified in C++. There are a number of macros available to make the job of coding simpler (see "Build Stage Macros". There are also a number of header files available containing many useful functions, see Header files.
When you have specified the information, and request that the stage is generated, IBM DataStage generates a number of files and then compiles these to build an operator which the stage executes. The generated files include:
- Header files (ending in .h)
- Source files (ending in .c)
- Object files (ending in .so)
Procedure
To define a build stage:
- From the Assets tab of your project, click and select Build stage. Create your build stage.
- Fill in the fields on the General tab.
- Fill in the Properties tab.
- Fill in the Build tab.
- When you have filled in the details in all the tabs, you can click Save to save the stage as an asset under the Assets tab. If you click Generate, the stage will be compiled and appear under the User-defined section of the DataStage design canvas. Once you have generated the stage, you cannot modify the operator name.