IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Problem while transforming XML to Copybook

    Posted 10/21/08 08:30 PM

    Originally posted by: dkbjr


    Hello All,

    I am new to Transformation Extender Design Studio and am trying to map XML to a COBOL copybook. It looks like I got the mapping done as everything looked good with one input. However, when I try it with multiple 'lines' of XML input I only get one output record.
    Anyone have any idea why this would happen?

    Thanks,
    Don
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Problem while transforming XML to Copybook

    Posted 10/22/08 03:24 AM

    Originally posted by: janhess


    Your output probably has only 1 occurrence. You need multiple occurrences and use a functional map.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Problem while transforming XML to Copybook

    Posted 10/22/08 10:08 AM

    Originally posted by: dkbjr


    Would you have a simple example that you can send me. This is my first time using this product without any training, so I apologize in advance if this is a basic fundamental that I should already know. In the mean time I will look through some documentation on doing this, as well.

    Thanks.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Problem while transforming XML to Copybook

    Posted 10/22/08 10:37 AM

    Originally posted by: SystemAdmin


    The structure of the XML document must match the structure of the COBOL Copybook. If an XML object occurs multiple times, it usually needs to be mapped to a corresponding Group in the copybook. Sometimes you need to manually modify the copybook, e.g., if you need to create multiple Report Groups and the the copybook desribes a single Report, create a ReportGroup consisting of multiple Reports in the copybook type tree.

    As was pointed out, you will need to use Functional Maps. This is a looping control used in a target object that can occur multiple times. Thus, if your XML source contains multiple line items named Item, you could use a map rule like "CreateLineItems(Item:XMLDoc, INDEX($))" You then right click on the map rule and use the FUnctional Map Wizard to create the FMap where you can add additional map rules. The FMap will execute once for each Item:XMLDoc in the source data. The optional INDEX($) passes a loop counter for use in things like a line item number.

    See if you can locate a copy of the Design Studio Tutorial, 1027.pdf. It shipped with earlier versions of Mercator and perhaps DataStage TX. Unfortunately it's not part of the latest WTX distributions. Possibly IBM Support can supply you with a copy or you can "borrow" a copy from someone. It's a copyrighted document so I can't just make a copy for you.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 5.  Re: Problem while transforming XML to Copybook

    Posted 10/22/08 08:02 PM

    Originally posted by: dkbjr


    I'm getting closer. I setup the multiple occurences and the functional map and now all the input is being mapped to the output. The only problem is that the output keeps appending to itself rather than going on a seperate line.

    Did I miss something during the setup or does a newline character need to be inserted?
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: Problem while transforming XML to Copybook

    Posted 10/22/08 10:45 PM

    Originally posted by: SystemAdmin


    Presumably you can write a new line at the end of each record. See the SYMBOL function. However, adding a NL terminator to the target object in the output type tree is probably more elegant.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Problem while transforming XML to Copybook

    Posted 10/23/08 02:45 PM

    Originally posted by: dkbjr


    I added the NL terminator to the target object in the output type tree and it works perfectly now.

    Thanks alot for all your help!!
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 8.  Re: Problem while transforming XML to Copybook

    Posted 11/20/08 05:11 AM

    Originally posted by: SystemAdmin


    Could you please send me more details of how you managed to do that ?. I was trying to do the same of mapping a repeatable node in XML to a COBOL group item but it is showing only the first occurrence in the output.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Problem while transforming XML to Copybook

    Posted 11/20/08 05:15 AM

    Originally posted by: janhess


    post your map & type trees and I'll try to have a look today.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 10.  Re: Problem while transforming XML to Copybook

    Posted 11/20/08 08:20 AM
      |   view attached

    Originally posted by: SystemAdmin


    I had attached the MAP and the output copybook structure below...

    000001 01 W-SCHEMES-INPUT-REC.
    000002 05 W-0087I-INPUT-DATA.
    000003 10 W-0087I-CRUD-INDICATOR
    000004 PIC X(1).
    000005 10 W-0087I-PERSONNEL-NO PIC X(12).
    000006 10 W-0087I-CONCESS-LIMIT PIC S9(09) COMP.
    000007 10 W-0087I-CONCESS-LMT-IND PIC X(01).
    000008 10 W-0087I-CORP-PANEL-NO
    000009 PIC X(12).
    000010 10 W-0087I-NO-OF-CHOSEN-SCHEMES
    000011 PIC S9(4) COMP.
    000012 05 W-0087I-SCHEMES-TYP-REC OCCURS 1 TO 5 TIMES.
    000013 10 W-0087I-CHOSEN-SCHEME-TYP
    000014 PIC X(2).
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)