Defining wrapped stages in DataStage
You define a Wrapped stage to specify a UNIX command to be run by a DataStage stage.
About this task
You define a wrapper file that handles arguments for the UNIX command and inputs and outputs. DataStage® provides an interface that helps you define the wrapper. The stage will be available to all jobs in the project in which the stage was defined. You can export the project that contains this stage along with other assets that are defined in the project in the form of a .zip folder. You can add the stage to your job palette by using palette customization features in DataStage.
When you define a Wrapped stage, you provide the following information:
- Details of the UNIX command that the stage will run.
- Description of the data that will be input to the stage.
- Description of the data that will be output from the stage.
- Definition of the environment in which the command will run.
The UNIX command that you wrap can be a built-in command, such as grep, a third-party utility, or your own UNIX application. The only limitation is that the command must be `pipe safe' (to be pipe safe, a UNIX command reads its input sequentially, from beginning to end).
You need to define metadata for the data that is input to and output from the stage. You also need to define how the data will be input or output. UNIX commands can take their inputs from standard in, or another stream, a file, or from the output of another command by way of a pipe. Similarly, data is output to standard out, or another stream, to a file, or to a pipe to be input to another command. You specify what the command expects.
DataStage handles data that is input to the Wrapped stage and will present it in the specified form. If you specify a command that expects input on standard in, or another stream, DataStage will present the input data from the jobs data flow as if it was on standard in. Similarly, it will intercept data output on standard out, or another stream, and integrate it into the job's data flow.
You also specify the environment in which the UNIX command will be run when you define the wrapped stage.
Procedure
To define a Wrapped stage: