Scenario: Handling data with AS/400 - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario describes a Job that writes the user information into AS/400, and then reads the information in AS/400 and displays it on the console.

Adding and linking the components

  1. Create a new Job and add a tFixedFlowInput component, a tAS400Output component, a tAS400Input component, and a tLogRow component by typing their names in the design workspace or dropping them from the Palette.

  2. Connect tFixedFlowInput to tAS400Output using a Row > Main connection.

  3. Do the same to connect tAS400Input to tLogRow.

  4. Connect tFixedFlowInput to tAS400Input using a Trigger > OnSubjobOk connection.

Configuring the components

Writing the data into AS/400

  1. Double-click tFixedFlowInput to open its Basic settings view.

  2. Click the [...] button next to Edit schema and in the [Schema] dialog box define the schema by adding three columns: id of Integer type, and name and city of String type.

    Click OK to close the [Schema] dialog box and accept the propagation prompted by the pop-up dialog box.

  3. In the Mode area, select Use Inline Content (delimited file) and enter the following user information in the Content field.

    1;George;Bismarck
    2;Abraham;Boise
    3;Taylor;Nashville
    4;William;Jefferson City
    5;Alexander;Jackson
    6;James;Boise
    7;Gerald;Little Rock
    8;Tony;Richmond
    9;Thomas;Springfield
    10;Andre;Nashville
  4. Double-click tAS400Output to open its Basic settings view.

  5. In the Host, Database, Username and Password fields, enter the information required for the connection to AS/400.

  6. In the Table field, specify the table into which you want to write the data. In this example, it is doct1018.

  7. Select Drop table if exists and create from the Action on table drop-down list, and select Insert from the Action on data drop-down list.

Retrieving the data from AS/400

  1. Double-click tAS400Input to open its Basic settings view.

  2. In the Host, Database, Username and Password fields, enter the information required for the connection to AS/400.

  3. Click the [...] button next to Edit schema and in the [Schema] dialog box define the schema by adding three columns: id of Integer type, and name and city of String type. The data structure is same as the structure you have defined for tFixedFlowInput.

  4. In the Table Name field, enter or browse to the table into which you write the data. In this example, it is doct1018.

  5. In the Query field, enter the SQL query sentence to be used to retrieve the user data from AS/400. In this example, it is SELECT * FROM doct1018.

  6. Double-click tLogRow to open its Basic settings view.

  7. In the Mode area, select Table (print values in cells of a table) for better readability of the result.

Saving and executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 or click Run on the Run tab to run the Job.

    As shown above, the user information is written into AS/400, and then the data is retrieved from AS/400 and displayed on the console.