Load the operator into DataStage
As DataStage does not have access to the environment you set up for development, you have to make a few changes so that DataStage can find your operator. First, your operator's dll file is not inside Windows' or DataStage's PATH environment variable, the easiest way to put your operator into the PATH is to move the dll into the PXEngine's bin directory. Alternatively, you can update your windows PATH variable to include your project's directory.
However, the operator is still not found by DataStage, as there is no mapping from the dll to the OSH name. To fix this, open up the PXEngine's main operator.apt file, located in e:\IBM\InformationServer\Server\PXEngine\etc\, then add myhelloworld myhelloworld 1 to this file.
Before starting this section, you need to know some of the following information about your DataStage environment:
- DataStage username
- DataStage password
- DataStage server name
- DataStage server port
- DataStage project
- Start DataStage Designer and log into a project that you are able to use.
- Once you are inside, right-click any folder in the repository view.
-
Select New > Other > Parallel Custom Stage Type.
Figure 2. Path to setting the stage type
-
Fill in the tabs as show in the following figures. You do not need to modify the mapping tab.
Fill in the following under the General tab:
-
Stage type name -- With the name of your operator (
myhelloworld) -
Operator -- With the name of your operator (
myhelloworld) -
Short description -- A short description of what the operator does (
hello world operator)
Figure 3. General tab
Fill in the following under the Links tab:
-
Stream inputs Maximum -- With the maximum number of input links (
1) -
Stream inputs Minimum -- With the minimum number of input links (
1) -
Outputs Maximum -- With the maximum number of output links (
1) -
Outputs Minimum -- With the minimum number of output links (
1)
Figure 4. Links tab
Fill in your information in the appropriate text boxes under the Creator tab.
Figure 5. Creator tab
Add a new property under the Properties tab.
-
Property name -- The name of the parameter as defined in the operator(
uppercase) -
Data Type -- The data type (
boolean) -
Default Value -- Default value to use (
False) -
Required -- If the property is required (
No)
Figure 6. Properties tab
-
Stage type name -- With the name of your operator (
-
Click Ok. This brings up the Save as dialog box. Select an appropriate place to save, (the example uses the processing operator type folder) then click Save.
Figure 7. Save as
-
You should now see a myhelloworld operator inside the Processing tab of the palette.
Figure 8. Processing tab
-
To check that everything has completed successfully, build a simple parallel job to test the new custom operator. Create a job by dragging two sequential file operators and the myhelloworld operator onto the canvas, then link them together as shown in Figure 9.
Figure 9. Link the operators together
-
Open the two sequential file operators and set the details of the files they are reading from or writing to.
Figure 10. Add the location of the file to read from
Figure 11. Add the location of the file to write to
-
Open the myhelloworld operator and set the uppercase parameter to True.
Figure 12. Add "uppercase" to the list of parameters
Figure 13. Set uppercase to be true
-
Inside the myhelloworld operator, go to Input > Columns, and add the input column. Add a new column with the column name inCount and the SQL type Integer.
Figure 14. Add input column information
-
Go to Output > Columns, and add the output columns. Add two new columns one with the column name outCount and the SQL type Integer, and another with the column name outHello and the SQL type Varchar.
Figure 15. Add output column information
-
Save your job, then click the Compile icon.
Figure 16. Click the Compile icon
This should result in the compile success dialog box.
Figure 17. Compile successful dialog box
-
Click the Run icon, which spawns the run dialog box, where you click Run.
Figure 18. Click the Run icon
Figure 19. Click Run
-
If all goes well, in a couple of seconds the links should turn green in your canvas and display the number of records they have processed.
Figure 20. Completed process
Congratulations! You now have a working MyHelloWorld operator inside DataStage.

