Example 1: Setting up the job and configuring the stages

John sets up a job that includes one Hierarchical Data stage and one Sequential File stage. He then configure columns for the Sequential File stage.

About this task

The following figure shows the job that John creates. The job includes a Hierarchical Data stage named Hierarchical_POST and a Sequential File stage named Sequential_File_POST. The Hierarchical_POST stage is linked to the Sequential_File_POST stage by a link named httpPOST.

The HTTP POST example.

Procedure

  1. Start the IBM® InfoSphere® DataStage® and QualityStage® Designer client.
  2. In the Repository pane, right-click the Jobs folder, and then click New > Parallel job.
  3. Open the Real Time section of the palette, and drag one Hierarchical Data stage to the canvas.
  4. Open the File section of the palette, and drag one Sequential File stage to the canvas. Position the Sequential File stage to the right of the Hierarchical Data stage.
  5. Create the job parameters:
    1. Select Edit > Job Properties.
    2. On the Parameters tab, specify the job parameters for the HTTP POST example, which are listed in the following table, and then click OK.
      Table 1. Job Parameters for the HTTP POST example
      Parameter Name Prompt Type
      Directory Specify the directory where the input or output file is created String
      restServer Specify the IP address of the REST server where the REST service is running String
      restServerPort Specify the port number of the REST server on which the REST service is running String
  6. Create a link from the Hierarchical Data stage to the Sequential File stage.
  7. Rename the stages and links as shown in the following table.
    Table 2. Names for job elements
    Element Name
    Hierarchical Data stage Hierarchical_POST
    Sequential File stage Sequential_File_POST
    Link from the Hierarchical_POST stage to the Sequential_File_POST stage httpPOST
  8. Configure the Sequential_File_POST stage:
    1. Double-click the Sequential_File_POST stage, and configure the columns that are listed in the following table on the Columns page.
      Table 3. Columns for the Sequential_File_POST stage
      Column name SQL type
      success VarChar
      errorMessage VarChar
      faultHttpStatusCode VarChar
      faultHttpBody VarChar
      httpVersion VarChar
      statusCode VarChar
      reasonPhrase VarChar
      body VarChar
    2. On the Properties page, configure the properties that define the output file.
      Table 4. Properties for the output file
      Property Value
      Target > File The path where you want the output file to be created, followed by the file name, for example, #Directory#/output_http.txt.
      Target > File Update Mode Overwrite
      First line is column name True
    3. Click OK to close the Sequential_File_POST stage.
  9. Click File > Save, and name the job rest_POST.
    Note: When you change the link name, or you add, delete, or modify datastage columns or job parameters on the DataStage designer, you need to reopen and save the assembly in the Hierarchical Data stage to validate the assembly design.