Lab Guide EDI - PDF - EN
Lab Guide EDI - PDF - EN
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.
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.
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
LESSON 1 | 9
3. Click the Start Now button if the Welcome screen shows up. Otherwise, go to the next step.
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.
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):
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:
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.
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.
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.
LESSON 1 | 23
4. Drag & drop the EDI_With_header Structure created earlier to the Input area:
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.
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.