August 17, 2023

tFileInputEBCDIC – Docs for ESB 5.x

tFileInputEBCDIC

tFileInputEBCDIC_icon32_white.png

Warning

This component requires an Oracle JDK to be functional.

tFileInputEBCDIC properties

Component family

File/Input

Note that this component is deprecated. The EBCDIC handling capabilities are now fully
supported by Talend Data Mapper that comes with any Talend Platform
solutions. For more information about Talend Data Mapper, see Talend Data Mapper User Guide.

Function

tFileInputEBCDIC reads an EBCDIC
file and extracts data depending on the selected schema.

Purpose

tFileInputEBCDIC opens a file and
reads it in order to separate the data, based on the file structure
description (schemas), and to send the file data and metadata to the
next Job component(s), via a Row >
Main connection.

Basic settings

Property type

Either Built-in or Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

 

 

Built-in: No property data stored
centrally.

 

 

Repository: Select the repository
file where the properties are stored. The fields that follow are
completed automatically using the data retrieved.

 

Schema(s)

Click [+] to add one or more
lines and click […] in the
Schema column of one selected
line to define the schema for the data to be processed. Editable
schema name will be displayed in the Distinguish field value column of the selected
line.

 

Data file

Click […] to browse to or type
in the path to the EBCDIC file containing the data to be processed.

 

Edit schema

Click […] to edit the Built-in
or Repository schema for the data to be processed.

Note

This button is enabled when you select the Custom set Original Length in Schema
check box.

 

 

Built-in: Select this option to
edit the Built-in schema for the data to be processed.

 

 

Repository: Select this option to
edit the Repository schema you select. The field that follows is
completed automatically using the schema you select.

 

Xc2j file

Click […] to browse to or type
in the path to the xc2j file to transform the EBCDIC schema(s) into
an intermediary XML file.

Note

This field will be disabled and xc2j file will not be
needed when you select the Custom set
Original Length in Schema
check box.

 

Custom set Original Length in Schema

Select this check box to improve the speed of reading
files.

Note

When you select this check box, the Xc2j
file
field will be disabled and xc2j file will
not be needed and you are able to edit the Built-in or
Repository schema for the data to be processed.

 Advanced settings

Encoding

Select the encoding type from the list or select Custom and define it manually. This field
is compulsory for DB data handling.

 

Trim all column

Select this check box to remove leading and trailing whitespaces
from defined columns.

 

tStatCatcher Statistics

Select this check box to gather the processing metadata at the Job
level as well as at each component level.

Global Variables

NB_LINE: the number of rows processed. This is an After
variable and it returns an integer.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Usage

Use this component to read an EBCDIC file and to output the data
separately depending on the schemas identified in the file.

Log4j

The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User
Guide
.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Scenario: Extracting data from an EBCDIC file

This scenario describes a Job that reads an EBCDIC file, extracts the data and then
displays the data based on its three different schemas.

components-tfileinputebcdic_s1_job.png

Note

This scenario uses the [EBCDIC Connection] wizard
that guides the user through several steps to create a connection to a Copybook file
which describes the structure of the corresponding EBCDIC file and then retrieve its
various schemas. This wizard is available only for users who have subscribed to one
of the Talend solutions. For more information about how to use this
wizard, please see Talend Studio
User Guide.

In this scenario, the EBCDIC connection is called ebcdic, and it contains three different schemas called _0, _1, and
_2, which are used in the
tExtractEBCDICFields components in the Job.

components-tfileinputebcdic_s1_copybook.png

Dropping the components

  • Create a Job and add the following components by typing their names in the
    design workspace or dropping them from the Palette: one tFileInputEBCDIC component, one tMap component, three tExtractEBCDICFields components, and three tLogRow components.

Configuring the input component

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

    components-tfileinputebcdic_s1_tfileinputebcdic.png
  2. Select the Custom set Original Length in
    Schema
    check box.

  3. Click the […] button next to Edit schema to open the schema editor of
    tFileInputEBCDIC.

    components-tfileinputebcdic_s1_tfileinputebcdic_schema.png
  4. Click the [+] button to add two columns
    recid and filler to extract the ID field of each schema in the
    recid column and leave other fields
    in the filler column.

    Note that you need to set the right value for the following fields for
    each column:

    • Type: Select the type of the
      schema column.

    • DB Type: Select the type of the
      corresponding field in the EBCDIC file.

    • Length: Specify the length of the
      schema column.

    • OriginalLength: Specify the
      length of the corresponding field in the EBCDIC file. In this
      example, 1099 is the total length
      of other fields except the ID field in each schema.

    • ImpliedDecimal: Fill true or
      false to indicate whether there is a decimal point implied at a
      specified location in a field in the EBCDIC file.

    • Signed: Fill true or false to
      indicate whether a field is signed or not in the EBCDIC file.

    • Precision: Specify the number of
      digits to the right of the decimal point.

  5. Click OK to save the settings and close
    the schema editor.

  6. Click the […] button next to the
    Data file field and browse to the
    EBCDIC file holding the data to be processed, E:/tFileInputEBCDIC/ebcdic_data.txt in this example.

  7. Connect tFileInputEBCDIC to tMap using a Row
    > Main connection.

Configuring the tMap component

  1. Right-click tMap and then select
    Row> *New Output*
    (Main)
    from the contexual menu and click the first tExtractEBCDICFields. Enter rec1 in the pop-up dialog box and click
    OK to connect tMap to the first tExtractEBCDICFields using a link named rec1.

    Repeat this step to connect tMap to the
    second and third tExtractEBCDICFields
    components using rec5 and rec9 links respectively.

  2. Double-click tMap to open its map
    editor.

    components-tfileinputebcdic_s1_tmap.png
  3. Drag all columns from the input table row1 to the output tables rec1, rec5, and rec9 respectively.

  4. Click the Expression_Filter.png button on the upper right corner of the output table
    rec1 to activate the expression
    filter and then fill it with the condition row1.recid.equals(“1”).

    Repeat this step to activate the expression filter of the output tables
    rec5 and rec9 and then fill them with the conditions row1.recid.equals(“5”) and row1.recid.equals(“9”) respectively. This way,
    the data with three different schemas will be separated to three
    destinations respectively according to their ID value.

  5. Click OK to save the settings and close
    the map editor.

Configuring tExtractEBCDICFields components

  1. Double-click the first tExtractEBCDICFields to open its Basic
    settings
    view.

    components-tfileinputebcdic_s1_tExtractEBCDICFields1.png
  2. Select Repository from the Schema list and then click the […] button to open the [Repository Content] dialog box where you can select the
    repository schema for this component.

    components-tfileinputebcdic_s1_tExtractEBCDICFields2.png
  3. Select the schema _0 under the
    ebcdic connection for the first
    tExtractEBCDICFields and click
    OK to save the setting and close the
    dialog box.

  4. Click the […] button next to Edit schema, select View
    schema
    in the pop-up dialog box and click OK to open the schema editor.

    components-tfileinputebcdic_s1_tExtractEBCDICFields3.png
  5. Clear the check box in Used Column for
    the HDRRECID column which has already
    been extracted from tFileInputEBCDIC to
    remove it from the schema, and then click OK to save the setting and close the schema editor.

  6. Select filler from the Field list to extract the data from this field in
    EBCDIC encoding.

  7. Repeat the previous steps, from Step 1 to
    Step 6, to set the repository schema
    _1 for the second tExtractEBCDICFields, remove the DTLRECID column from the schema, and select
    filler from the Field list.

  8. Repeat the previous steps, from Step 1 to
    Step 6, to set the repository schema
    _2 for the third tExtractEBCDICFields, remove the TRLRECORDID column from the schema, and select
    filler from the Field list.

  9. Connect each tExtractEBCDICFields to each
    tLogRow using a Row > Main connection
    respectively.

Configuring tLogRow components

  1. Double-click the first tLogRow to open
    its Basic settings view.

    components-tfileinputebcdic_s1_tlogrow.png
  2. Select the Print component unique name in front of
    each output row
    check box for a better display of the
    results.

  3. Repeat the previous two steps to configure the second and third tLogRow components.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6 to execute the Job.

    components-tfileinputebcdic_s1_result.png

    The extracted data is displayed on the console.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x