Table of Contents

Search

  1. Preface
  2. Informatica Managed File Transfer Welcome Overview
  3. Dashboard
  4. Resources
  5. Workflows
  6. Task Reference
  7. Services Overview
  8. Users
  9. Logs and Reports
  10. Encryption
  11. System
  12. Appendix
  13. Glossary Terms

Example 2: Modify RowSet Using Existing Columns

Example 2: Modify RowSet Using Existing Columns

In this example, a Read CSV task creates a RowSet variable named myData that contains 6 columns of data. The following graphic illustrates the CSV data contained in the RowSet:
Example data:
${myData} RowSet Variable
${myData[1]}
${myData[2]}
${myData[3]}
${myData[4]}
${myData[5]}
${myData[6]}
34594
Heather
Banks
1998-01-19
bb001
72000
34593
Tina
Young
2010-04-01
bb001
65000
34590
Kathy
Harris
2007-09-30
kh001
105000
34592
Mark
Walker
2012-11-15
kh001
87500
34591
John
Davis
2001-06-15
kh001
85000
The Modify RowSet task will be used to modify the column at Index 5, and remove columns 1 and 2. Also, any rows that contain a number greater that 80000 at Index 6 will be excluded in the Output RowSet variable. Follow the steps below to use data from a RowSet, modify existing columns, and output the results to a new RowSet:
  1. From within the Project Designer page, expand the Data Translation folder in the Component Library, and then drag the Read CSV task to the Project Outline.
  2. On the Basic tab of the Read CSV task, specify the following values:
    Input File
    Specify the path and file name of a single file to read the data from.
    Output Row
    Set VariableSpecify the name of a variable which will contain the data read from the specified input file(s). The variable will be of type RowSet and may be used in subsequent tasks that accept a RowSet input variable. The variable will be created if it does not exist. For this example, the variable myData was used.
  3. From within the Project Designer page, expand the Data Translation folder in the Component Library, and then drag the Modify RowSet task to the Project Outline.
    1. On the Basic tab of the Modify RowSet task, specify the following values:
    Input RowSet VariableSpecify the name of a variable of type RowSet which contains the data to modify. For example, ${myData}.
    Output RowSet VariableSpecify the name of the variable that will contain the modified data. This will be a variable type of RowSet. If this variable exists it will be overwritten, otherwise it will be created.
    Start With Existing ColumnsChoose if you want to start with all columns from the input RowSet (true) or would rather specify which columns you want specifically (false). Choose true.
    Exclude Row IfSpecify a condition that will exclude a row if it is satisfied and prevent it from being included in the output variable. In this example any row that contains an amount greater than 80000 in column 6 will be excluded.
    1. In the Modify RowSet task window, from the
      Add
      button in the sub-menu, click
      Add Modify Column
      .
    2. Specify the Index for the column to modify, and enter a new column value. In the example, the string data in column 5 will be converted to uppercase text (i.e. from 'bb001' to 'BB001').
    3. In the Modify RowSet task window, from the
      Add
      button in the sub-menu, click
      Add Remove Column
      .
    4. Specify the Index for the column you want to remove. In the example, the column at Index 1 will be removed.
    5. In the Modify RowSet task window, from the
      Add
      button in the sub-menu, click
      Add Remove Column
      .
    6. Specify the Index for the column you want to remove. In the example, the column at Index 2 will be removed.
    7. When the Project executes, the modifiedData RowSet Variable will contain 4 columns. Rows that contained an amount greater than 80000 from column 6 of the Input RowSet are removed.
      The following image illustrates the Project Outline for the Modify RowSet task:
  4. On the Basic tab of the Modify RowSet task, specify the following values:
    Input RowSet Variable
    Specify the name of a variable of type RowSet which contains the data to modify. For example, ${myData}.
    Output Row
    Set VariableSpecify the name of the variable that will contain the modified data. This will be a variable type of RowSet. If this variable exists it will be overwritten, otherwise it will be created.
    Start With Existing Columns
    Choose if you want to start with all columns from the input RowSet (true) or would rather specify which columns you want specifically (false). Choose true.
    Exclude Row If
    Specify a condition that will exclude a row if it is satisfied and prevent it from being included in the output variable. In this example any row that contains an amount greater than 80000 in column 6 will be excluded.
  5. In the Modify RowSet task window, from the
    Add
    button in the sub-menu, click
    Add Modify Column
    .
  6. Specify the Index for the column to modify, and enter a new column value. In the example, the string data in column 5 will be converted to uppercase text (i.e. from 'bb001' to 'BB001').
  7. In the Modify RowSet task window, from the
    Add
    button in the sub-menu, click
    Add Remove Column
    .
  8. Specify the Index for the column you want to remove. In the example, the column at Index 1 will be removed.
  9. In the Modify RowSet task window, from the
    Add
    button in the sub-menu, click
    Add Remove Column
    .
  10. Specify the Index for the column you want to remove. In the example, the column at Index 2 will be removed.
  11. When the Project executes, the modifiedData RowSet Variable will contain 4 columns. Rows that contained an amount greater than 80000 from column 6 of the Input RowSet are removed.
Example Output RowSet Data:
${modifiedData} RowSet Variable
${modifiedData[1]}
${modifiedData[2]}
${modifiedData[3]}
${modifiedData[4]}
Banks
1998-01-19
BB001
72000
Young
2010-04-01
BB001
65000

0 COMMENTS

We’d like to hear from you!