DataFlux Data Management Studio 2.6: User Guide

Running a Java Program in a Data Job

Plan the Data Job

Identify goals that can be met by running a Java program in a data job. For example, you might want to demonstrate how the Java Plugin node can be used to run a simple Java program.

Configure the computer that will run the data job. See Set up for the Java Plugin Node.

Identify or create the Java program that will help you meet your goals. For example, you might create a job that runs SimpleStepExample, one of the sample programs installed with Data Management Studio and Data Management Server. See Example Java Programs for the Java Plugin Node.

Be sure that the Java program that you want to run in the data job is in the Java classpath. The SimpleStepExample program is in the Java classpath by default.

Identify the inputs and outputs that you'll need for the data job. The SimpleStepExample program takes an integer value as an input, adds a specified number to the input, and outputs the sum as an integer. Accordingly, you could create a data job with a flow similar to the following display: 

The first node is a Text File Input node. It specifies a text file with at least one column of integer values. The second node is a Java Plugin node that will run the SimpleStepExample program against the input text file.

Create the Data Job

The goal is to create a data job that looks similar to the one described in the previous planning topic. It is assumed that you know how to create a data job as described in Creating a Data Job in the Folders Tree.

  1. Create an empty data job.
  2. In the data job node tree, open the Inputs folder and drag a Text Input node into the job editor.
  3. Open the Utilities folder and drag a Java Plugin node into the job editor on the right.
  4. Connect the nodes so that the flow looks similar to the one shown in the previous planning topic.
  5. Right-click the Text Input node and select Properties.
  6. Specify an appropriate text file in the Input file field.
  7. In the Fields area, specify the fields in the text file, as shown in the next display.

  8. Click OK to save your changes.
  9. Right-click the Java Plugin node and select Properties.
  10. Select the SimpleStepExample program in the Java Class field. The parameters associated with that class will display.
  11. Specify values for each parameter as appropriate for the input. For example, you might specify the input field Total Sales as the target of the sum operation performed by SimpleStepExample. You might specify 20000 as the number to be added to the value of the Total Sales field, as shown in the next display.

  12. Click OK to save your changes.

The job should be operational at this point.

Verify the Output

Click the Run icon in the job editor. The job should run successfully.

Right-click the Java Plugin node and select Preview. The output will display in the Details pane in the job editor, as shown in the next display.

The Preview shows that 20000 was added to the value in the Total Sales field.


Related Topics

Documentation Feedback: yourturn@sas.com
Note: Always include the Doc ID when providing documentation feedback.

Doc ID: dfU_PFUtil_JavaPlugin_SampleJob.html