IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
Expand all | Collapse all

Generic COBOL to XML format transformation

  • 1.  Generic COBOL to XML format transformation

    Posted Mon February 02, 2009 03:17 PM

    Originally posted by: stephaneuh


    Hello,

    I'm trying to generate and XML file from a copybook with WTX.
    I'm already able to generate a copybook from an XML input, but I have some issues for the reverse operation.

    What I've done is that I created a new map, put my copybook type tree as an input and the xsd type tree as an output.
    Next I took some fields from the copybook and ,linked them to the corresponding XML field.

    When I try to execute this map, I receive this error: One or more inputs was invalid.

    Any idea if I forgot something?

    Thx
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: Generic COBOL to XML format transformation

    Posted Mon February 02, 2009 03:21 PM

    Originally posted by: janhess


    Could be something wrong with your input data. Check the trace file.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Generic COBOL to XML format transformation

    Posted Mon February 02, 2009 05:02 PM

    Originally posted by: stephaneuh


    Thanks for your reply.

    Actually the trace View is empty; Is there anything to do to activate the trace?

    By the way, when I execute the map, in the results popup I can see:

    One or more inputs was invalid
    Input: 1 of 1 Objects: 28
    Output: 0 of 0

    In my copybook I have 28 objects (groups + fields).
    So I guess, I'm not so far from the solution...
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Generic COBOL to XML format transformation

    Posted Tue February 03, 2009 05:22 AM

    Originally posted by: janhess


    Activate the trace on the map settings. If you are getting invalid objects it will show in the .mtr file.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Generic COBOL to XML format transformation

    Posted Tue February 03, 2009 10:08 AM

    Originally posted by: stephaneuh


    Great!

    In the trace, the same error is coming a couple of time:
    ---
    (Level 3: Offset 41, len 4, comp 2 of 12, #1, DI 00000004:)
    Data at offset 41 ('AAAA...') not in RESTRICTION LIST of TYPE
    X'000E' (FIELD_ENVIRONMENT Field CopyBook).

    (Level 3: Offset 41, len 4, comp 2 of 12, #1, DI 00000004:)
    Data at offset 41 ('AAAA') is INVALID data of TYPE
    X'000E' (FIELD_ENVIRONMENT Field CopyBook).

    ---
    The field FIELD_ENVIRONMENT(len 4) has a Text type (Interpret as Character)
    Do you know what RESTRICTION LIST means?

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


  • 6.  Re: Generic COBOL to XML format transformation

    Posted Tue February 03, 2009 10:28 AM

    Originally posted by: janhess


    So the restriction list in the type tree for FIELD_ENVIRONMENT Field CopyBook does not allow the value 'AAAA'
    Check Item Subclass/Restrictions. If you double click in the item it should show you the restriction values.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: Generic COBOL to XML format transformation

    Posted Tue February 03, 2009 04:17 PM

    Originally posted by: stephaneuh


    You're right! this field was an enumeration with a few defined values.

    So I'm almost done,but now I'm wondering how to link a Copybook Group to an XML Group

    In the copybook input, I have a Group: COPYBOOK_MESSAGES (0:20) with 6 text fields.
    In the XML output, I have the corresponding group: MESSAGES (0:20) with 6 text fields.

    Is there a way to map automatically those 2 groups?
    I know how to add an index on the XML side, so do I have to add 20 Indexes?
    Thanks again for your help.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: Generic COBOL to XML format transformation

    Posted Wed February 04, 2009 03:19 AM

    Originally posted by: janhess


    Use a functional map on the XLM group MESSAGES passing the cobol group COPYBOOK_MESSAGES as the parameter, use the functional map wizard to create the map and then map the items.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Generic COBOL to XML format transformation

    Posted Wed February 04, 2009 03:27 PM

    Originally posted by: stephaneuh


    That's it, I'm done, as you said I created a functional map and then in the executable map I made a reference to this functional map.

    Thank you again for you help, I learned a lot through this post!
    bye
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 10.  Re: Generic COBOL to XML format transformation

    Posted Thu March 12, 2009 02:47 PM

    Originally posted by: stephaneuh


    Hello

    This time I'm trying to understand how arrays indexes are working in WTX.
    I have a map that converts Copybook to XML.

    On the XML side I'm able to get the content of a specific array in the copybook (*MESSAGES_DETAIL*), with something like that:

    =IDENTIFICATEUR Field:MESSAGES_DETAIL[0]:MESSAGES_INFO:MESSAGES Group:Copybook_Response

    Now I'm trying to use a variable instead of the hardcoded index MESSAGES_DETAIL[0]
    I tried : MESSAGES_DETAILTEXTTONUMBER(MESSAGES_NB_BLOC Field:MESSAGES Group:Copybook_Response)

    But it says that the rule is invalid... any idea?
    Thanks a lot.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 11.  Re: Generic COBOL to XML format transformation

    Posted Thu March 12, 2009 02:48 PM

    Originally posted by: stephaneuh


    New interrogation on WTX
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange