0% found this document useful (0 votes)
72 views

Lab Guide EDI - PDF - EN

This lesson teaches how to map an EDI format by creating an input structure manually to match sample data, testing the structure on sample data, reusing an existing EDI structure for output, and creating a map between the input and output structures.

Uploaded by

RM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Lab Guide EDI - PDF - EN

This lesson teaches how to map an EDI format by creating an input structure manually to match sample data, testing the structure on sample data, reusing an existing EDI structure for output, and creating a map between the input and output structures.

Uploaded by

RM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Lab Guide

TDM Optional Modules
Version 6.1
Copyright 2016 Talend Inc. All rights reserved.
Information in this document is subject to change without notice. The software described in this document is furnished under a license
agreement or nondisclosure agreement. The software may be used or copied only in accordance with the terms of those agree-
ments. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or any means electronic
or mechanical, including photocopying and recording for any purpose other than the purchaser's personal use without the written
permission of Talend Inc.
Talend Inc.
800 Bridge Parkway, Suite 200
Redwood City, CA 94065
United States
+1 (650) 539 3200
Welcome to Talend Training
Congratulations on choosing a Talend training module. Take a minute to review the following points to help you get the most from
your experience.

Technical Difficulty

Instructor-Led
If you are following an instructor-led training (ILT) module, there will be periods for questions at regular intervals. However, if you
need an answer in order to proceed with a particular lab, or if you encounter a situation with the software that prevents you from pro-
ceeding, don’t hesitate to ask the instructor for assistance so it can be resolved quickly.

Self-Paced
If you are following a self-paced, on-demand training (ODT) module, and you need an answer in order to proceed with a particular
lab, or you encounter a situation with the software that prevents you from proceeding with the training module, a Talend Support
Engineer can provide assistance. Double-click the Live Expert icon on your desktop and follow the instructions to be placed in a
queue. After a few minutes, a Support Engineer will contact you to determine your issue and help you on your way. Please be con-
siderate of other students and only use this assistance if you are having difficulty with the training experience, not for general ques-
tions.

Exploring
Remember that you are interacting with an actual copy of the Talend software, not a simulation. Because of this, you may be tempted
to perform tasks beyond the scope of the training module. Be aware that doing so can quickly derail your learning experience, leaving
your project in a state that is not readily usable within the tutorial, or consuming your limited lab time before you have a chance to fin-
ish. For the best experience, stick to the tutorial steps! If you want to explore, feel free to do so with any time remaining after you've fin-
ished the tutorial (but note that you cannot receive assistance from Tech Support during such exploration).

Additional Resources
After completing this module, you may want to refer to the following additional resources to further clarify your understanding and
refine and build upon the skills you have acquired:
Talend product documentation (help.talend.com)
Talend Forum (talendforge.org/)
Documentation for the underlying technologies that Talend uses (such as Apache) and third-party applications that com-
plement Talend products (such as MySQL Workbench)
This page intentionally left blank to ensure new chapters
start on right (odd number) pages.

CONTENTS | Lab Guide


CONTENTS
LESSON 1 Mapping the EDI Format
Overview 8
Lesson Overview 8
Objectives 8
Next Step 8
Creating the Input Structure 9
Overview 9
Starting Talend Studio 9
Creating the Input Structure Manually 11
Setting the Representation Properties 18
Next Step 20
Testing the Structure 21
Next Step 22
Creating the Map 23
Next Step 26
Wrap-Up 27
Next Step 27
This page intentionally left blank to ensure new chapters
start on right (odd number) pages.

CONTENTS | Lab Guide


LESSON 1
Mapping the EDI Format
This chapter discusses the following.

Overview 8
Creating the Input Structure 9
Testing the Structure 21
Creating the Map 23
Wrap-Up 27
Overview

Lesson Overview
This lab provides an example of how to work with complex standards like EDI. It uses X12 Structures as an example.
ANSI X12 was originally conceived to support companies across different industry sectors in North America however today there are
more than 300,000 companies worldwide using X12 EDI standards in daily business transactions. It is important to be able to
read/write EDI formats, or map them to other standards like XML.

Objectives
After completing this lesson, you will be able to:
Create an input Structure manually so it matches a sample data file
Test the Structure on some sample data and check the elements are correctly described
Reuse an existing EDI Structure for the output
Create a Map between the manual input Structure and the existing output Structure
Test the Map and check the results are the expected ones

Next Step
First, let's create the input Structure manually so it matches the available data file.

8 | TDM Optional Modules - Lab Guide


Creating the Input Structure

Overview
The objective is to create a Structure that matches the available data:
The first line contains header information split across five fields
Each field is separated by |
The second line contains an ID, a | separator and then an EDI document
The last line is the end of file indicator

Starting Talend Studio


1. Click the Talend Studio link on the desktop.

2. Select the existing TDM-Essentials-EDI project and click Finish.

LESSON 1 | 9
3. Click the Start Now button if the Welcome screen shows up. Otherwise, go to the next step.

10 | TDM Optional Modules - Lab Guide


Creating the Input Structure Manually
1. Right-click Hierarchical Mapper > Structures then select New > Structure.

2. Select Create a new structure where you manually enter elements and click Next >:

3. Enter EDI_With_Header in the Structure name field and click Next >.

LESSON 1 | 11
4. Select Flat Files (including CSV) and click Finish.

5. The new Structure opens in the editor. Right-click anywhere in the empty area and select New Element.

12 | TDM Optional Modules - Lab Guide


6. Name the new element Root. Switch to the IO/Database tab at the bottom of the Studio, then drag and drop a Functions
> InputOutput and Database > ReadMapInput Function to it.

7. Right-click Root and select New Element to create a new child. Name the new element Header. Specify V in the Initiator
field to let Talend Data Mapper know the actual header record begins with a V (like in the sample value V000901 displayed
on the first two screenshots of this section). Finally, make sure the Include Initiator option is not selected, as the V char-
acter is not part of the actual header field.

8. Right-click Header and select New Element to create a new child element. Name it Header-field1 and specify | in the Ter-
minator field.

LESSON 1 | 13
9. Now let's duplicate Header-field1 to create three more children elements called Header-field2 to Header-field4. Right-click
Header-field1 and select Copy. Then select Header-field1, right-click it again and select Paste as Sibling to duplicate the
element. Repeat this last step twice and update the Name property of the new elements to match the following architecture:

10. To create the last header field, right-click Header-field4 and select Copy. Then right-click Header and select Paste:

11. Change the Name property of the new element to Header-field5 and the Terminator property to \n (meaning a new line):

14 | TDM Optional Modules - Lab Guide


12. Add a new EDI element under Root. Specify 0 and -1 in the Occurs Min/Max field to make it a looping element (confirmed
by the updated EDI (0:*) label) then enter \n in the Terminator field:

13. Create a new EdiID element under EDI. Enter | for the Terminator:

LESSON 1 | 15
14. Create a new Interchange element under EDI and then click the ... button next to the Inherits From field to select an exist-
ing Structure and let the new element inherit from it:

15. Select X12_5010_HIPPAA (Read Only) > Structures > Transactions > 271-B1-ENV (read Only) as the parent ele-
ment to inherit from then click OK:

16 | TDM Optional Modules - Lab Guide


16. Switch to the IO/Database tab of the new Interchange node, then drag and drop a Functions > InputOutput and Data-
base > ReadNestedFunction to it. Specifying this function will cause the data normally read for this element to be pro-
cessed using the representation of the structure from which this element inherits.

17. Double-click the ReadNested Function, select EDI for the representation after clicking the ... button then click OK:

LESSON 1 | 17
18. Finally, let's add the end of file indicator to the Structure. Create a new EOF child under Root, enter END OF FILE for the Ini-
tiator and \n for the Terminator. Again, make sure the Include Initiator option is not selected.

Setting the Representation Properties


1. Double click Hierarchical Mapper > Structures > EDI_With_Header > Representations > Flat to set the properties of
the flat representation.

18 | TDM Optional Modules - Lab Guide


2. Set Newline type to Specified Explicitly, enter \r (meaning carriage return) in the Newline character field then click OK:

LESSON 1 | 19
With these settings, TDM will always looks for a \r carriage return symbol to parse the data on each line, even if \n was spe-
cified in the Terminator field. It is necessary to differentiate a sequence of records from the rest of the file.

Next Step
Let's test the new Structure by displaying a sample document from the available data.

20 | TDM Optional Modules - Lab Guide


Testing the Structure
1. Expand Show Document and click Select Sample Document > Import Document from File... to use an existing doc-
ument and test the Structure definition on it.

2. Click Browse, select the C:\StudentFiles folder then select the ediwheader.txt file and click Finish:

3. Select an element in the Structure, like EdiID for example. The matching input data should be highlighted in the Document

LESSON 1 | 21
tab.

Next Step
With the Structure created and validated, let's create the associated Map.

22 | TDM Optional Modules - Lab Guide


Creating the Map
1. Right-click Maps and select New > Map:

2. Select Standard Map and click Next >:

3. Enter mrt2EDI for the Map Name and click Finish.

LESSON 1 | 23
4. Drag & drop the EDI_With_header Structure created earlier to the Input area:

5. Wait for the validation process to complete.

24 | TDM Optional Modules - Lab Guide


6. Drag & drop the Hiearchical Mapper > Other Projects > X12_5010_HIPAA > Structures > Transactions > 271-B1-
ENV Structure to the Output area of the map.

7. Expand the Structures on both sides and map Root > EDI (0:*) > Interchange > Loop-ISA (0:*) from the input to

LESSON 1 | 25
Interchange > Loop-ISA (0:*) on the output.

8. Right-click Loop-ISA (0:*) in the Output area and select Test Run to test the Map and check the results:

Next Step
This lesson is almost over. Head to the Wrap-Up section for a summary of the concepts reviewed in this lesson.

26 | TDM Optional Modules - Lab Guide


Wrap-Up
In this lesson, you learned how to:
Create an input Structure manually so it matches a sample data file
Test the Structure on some sample data and check the elements are correctly described
Reuse an existing EDI Structure for the output
Create a Map between the manual input Structure and the existing output Structure
Test the Map and check the results are the expected ones

Next Step
Congratulations, you successfully completed this lesson. Click the Check your status with this unit button below in order to save
your progress. Then click Completed. Let's continue > on the next screen to jump to the next lesson.

LESSON 1 | 27
This page intentionally left blank to ensure new chapters
start on right (odd number) pages.

You might also like