IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
  • 1.  windows to ZOS - XML file conversion issue

    Posted Mon June 29, 2015 02:37 PM

    Originally posted by: DeM0n


    Hi,

    We are running our WTX designer on windows. I created a map to create an XML file from a flat file. The data language is defined as "Native" in the type trees. The XML type tree is xerces, created by importing the schema in xerces format.

    The WTX designer Version: 8.4.0.2 and Build id: 12.

    When I run the map on windows, the XML file looks good but it gets all messed up on ZOS even when the data language is Native.

    It looks like the issue is with the ASCII to EBSDIC conversion.

    1) But why is it happening if the language is defined as "Native".

    2) How do I resolve it. Whats a possible sotution for it ?

     

    Thanks.....


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


  • 2.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 03:19 AM

    Originally posted by: paul.brett


    When working on z/OS, it is important to remember that "Native" means "EBCDIC".

    The setting itself is very handy, for when you want a map to work on both platforms, with source data for which you do not know the encoding upfront, and it is assumed that it matches the platform.

    When mapping XML on z/OS, and the XML is UTF-8 (i.e. exactly the same hex byte values are used to represent the data on both platforms - making the data unreadable to the human eye on z/OS) it is best to use the "UTF-8" setting instead of "NATIVE".

    I hope that has answered your questions.

    Thank-you.

    Paul.

    Follow me on Twitter


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


  • 3.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 09:40 AM

    Originally posted by: DeM0n


    Hi Paul...Thanks a ton for your response.

    I tried it with UTF-8 too earlier (I used the tree in the same way it was created by the designer)....same result....The XML output is messed up on z/OS with UTF-8 too....

    One more thing, I would like to add, The values that I am mapping looks fine on z/OS. It is just the XML tags that are not looking good at all.

    Also, this is happening when the type tree was created using xerces.

    We have other maps running absolutely fine. The type tree for these maps were created using classic.We changed these classic trees from UTF-8 to Native and then only they resulted the expected output.

    The problem is that we want to have the new type trees as xerces and not classic.

     

    Paul....Also in one of your posts you suggested to someone to change from native to EBCDIC while importing the type tree. How do you do that....I can not see any such option in the WTX designer when I import the schema to create the type tree....Please suggest !!!


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


  • 4.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 11:23 AM
      |   view attached

    Originally posted by: paul.brett


    Here's an example of one way to do it.

    In output card 1, I build the XML (in UTF-8)

    In output card 2, I store it as a text blob, and substitute the UTF-8 encoding string for IBM-1047.

    In output card 3, I write it out to disk, and the Typetree object used is an IBM-1047 encoded text blob.

    Thank-you.

    Paul.

    Follow me on Twitter


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

    Attachment(s)

    zip
    FlatFile2XML.zip   12 KB 1 version


  • 5.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 11:58 AM

    Originally posted by: DeM0n


    Thanks a lot Paul.....That will solve my problem....

    I found another mistake in my mapping.....I was defining encoding as UTF-8 in Decl Prolog....I changed it to ibm-037 and it is working fine now....

    But I had a header record before the actual XML....I used your method to convert that in EBCDIC and things look good now....

     

    Thanks again for all your help.....much appreciated.....


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


  • 6.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 04:21 PM

    Originally posted by: DeM0n


    Hey Paul....When I changed the encoding to ibm-037....then I can see the values correctly on z/OS...but there is a special character after each tag...it is a line feed, I guess....even on windows, my xml's each element is in a new line....

    How do I remove that...I do not want any newline and want the whole XML in one line....

     

    Even in the example that you sent has the same thing....each element is in a newline.....


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


  • 7.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 04:28 PM

    Originally posted by: paul.brett


    Use a SUBSTITUTE() to remove the <NL> characters.

     

    Thank-you.

    Paul.

    Follow me on Twitter


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


  • 8.  Re: windows to ZOS - XML file conversion issue

    Posted Tue June 30, 2015 04:36 PM

    Originally posted by: DeM0n


    tried it Paul...its not working.....

    FYI...its looking as "%" when I see it in textpad.....

    Is there anything that can be done in the type tree or mapping.....


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


  • 9.  Re: windows to ZOS - XML file conversion issue

    Posted Thu July 09, 2015 05:10 AM

    Originally posted by: paul.brett


    Are you trying to do the substitution on Windows or z/OS?

    % (in Notepad) on a Windows system is hex 25.  25 is a LF on z/OS

    SO, your substitute can be:

    =SUBSTITUTE(In1,"><LF>",">")

    ...although this map will only work on z/OS.

    You could also use:

    =SUBSTITUTE(In1,"><<25>>",">")

    ...and this map would work on both platforms.

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 10.  Re: windows to ZOS - XML file conversion issue

    Posted Mon July 13, 2015 11:32 AM

    Originally posted by: DeM0n


    Thanks a lot for your help and responses Paul....it helped me a lot....

    But we found out that there are some properties in xerces type trees that we can not modify....for example, changing the terminator....we can definitely use the REPLACE/SUBSTITUTE function to do the trick...

    We ended up using classic type tree as it gives us more options to paly within the type tree as compared to xerces type tree.....

    Thanks again for all your help !!!

     

    Regards

    Dhruv


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