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.  XML schema to cobol mapping

    Posted 11/14/11 04:34 AM

    Originally posted by: Jaango


    Hi All we have a requirement in converting xml utf8(a text) format to a cobol copybook, PIC S9(17) COMP-3, in EBCDIC.

    So if my text has "-1", it should be converted to 1D, in hex. "-1234" should be converted to 01 23 4D, in hex and so on. I tried using pack function, however doesnt seem to be working. Not sure if I have to do any conversion from the text to number?Similarly could anyone help in the unpack function also?Do I have to use BCD functions as COMP-3 is equivalent to BCD. Please advise.
    =TEXTTONUMBER(PACK(TEXTTONUMBER(inputfield)))
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: XML schema to cobol mapping

    Posted 11/16/11 01:36 PM
      |   view attached

    Originally posted by: jvanboga


    Did you import the copybook to build your type tree? I attached a sample tree and map for you. This tree was imported using the included copybook. The input file is not in xml but that shouldn't be an issue.

    If you need to convert to EBCDIC you can do that via the import or change it manually.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender

    Attachment(s)



  • 3.  Re: XML schema to cobol mapping

    Posted 11/16/11 01:47 PM

    Originally posted by: repanzer1


    Wow jvanboga, I was writing a response to this at the same time you must have. It's nice to break the daily tasks and come and help people out, huh?
    Jaango, like so many other aspects of WTX, it's been a while since I messed with any of this type of stuff, so I can only throw out random info and maybe it will help you out.

    What version of WTX are you on and what operating system is your deployment server/server the map will run on?

    Normally you don't have to convert anything as long as the type tree is set up correctly. So you can take a decimal value from a field defined as decimal, drag and drop it into a field in your output card that is defined as Numberic>binary and presentation equal to "Packed', and that should be what you get in your output. When you import a copybook into WTX with a COMP-3 field, that is how it will be defined. So what I would suggest is to have a simple map with just an output card with a field that is numeric, binary, packed, and put "-1" in it and view the output. Then use the pack function and see what you get until you figure out the set up you are looking for. Finally, have an input field defined as the input in your xml and the output as defined in the copybook and mess around until you get the results you want.
    There are 10 types of people in this world. Those who understand binary and those who don't.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: XML schema to cobol mapping

    Posted 11/16/11 02:17 PM

    Originally posted by: jvanboga


    :)

    Actually I started responding at about 8:am CST. Spent most of the morning trainging someone in on the usages of the DBID. Then there was lunch, etc....

    One of the coolest things about this tool is how little coding you really need sometimes. Many things can be handled by configuring your type trees properly. Character set conversion is amazingly easy. I had an architect in here a few years back poopooing the tool. Sent me a text file that was in an Indian character set. Went to the web googled a string of his charaters. found them and examined the page to determine the character set. Define a text blob input with his set and ascii blob for the output and mapped output = input ... badaboom.... converted to english. He stopped the trash talking.

    Anyway, type tree definition can make maps easy or challenging, lightweight or heavy...
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 5.  Re: XML schema to cobol mapping

    Posted 11/22/11 01:36 AM

    Originally posted by: Jaango


    Thanks everyone. I will try like the ways, suggested in my mapping :)
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: XML schema to cobol mapping

    Posted 11/22/11 10:06 AM

    Originally posted by: SystemAdmin


    I had a requirement to convert to a PIC 9(4) COMP.

    I had used the below functions and it seemed to work.
    BCDTOHEX(TEXTTOBCD(Text_to_convert)), 2)

    I had used ",2" because the field had the following definition,
    Item Subclass ==>Number
    Interpret As ==> Binary,
    Presentation ==> Integer
    Length(Bytes) ==> 2

    Hope this helps.

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


  • 7.  Re: XML schema to cobol mapping

    Posted 11/23/11 01:13 AM