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.  Convert function; pack decimal to ascii

    Posted 02/09/10 04:56 PM

    Originally posted by: repanzer


    The problem I’m having is taking data from the mainframe (EBCDIC) and moving to open systems (ascii). When I run the FTP, it does the convert from EBCDIC to the ascii equivalent, the problem is packed decimal fields. When converted, the hex behind the conversion takes place, but for those fields, I need to maintain the hex.

    So what I’m looking to do is, bring it down to ASCII, then for the pack decimal fields, un-convert them (go back to the value before the conversion)

    When I leave it as ebcidic and use WTX to convert, using the example under portdata dir in the install directory, the packed decimal works correctly, but then normal characters mess up.

    I could not figure out exactly how convert works and how I can use my own table. Any ideas? Any solutions pertaining to ebcdic packed decimal fields to ASCII would be appreciated.

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


  • 2.  Re: Convert function; pack decimal to ascii

    Posted 02/09/10 05:11 PM

    Originally posted by: repanzer


    If anyone can tell how to convert a hex B1 to a hex CA, that would do it.

    Keep in mind though, there are no ASCII printable characters for either of these hex values, because if each hex value had one, I would use SUBSTITUTE. Basically, I need to use SUBSTITUE on the hex level.

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


  • 3.  Re: Convert function; pack decimal to ascii

    Posted 02/09/10 06:21 PM

    Originally posted by: Rich_McFate


    My first choice would be to do a binary FTP from the mainframe (which would leave the numerics undisturbed). You would import the copybook (assuming there is one) using EBCDIC as the data language for text items. If there is no copybook, you could still generate the tree manually using data language = EBCDIC (or whatever IBM codepage your mainframe uses.)

    That gets around most of the problems at the cost of having the data going through your WTX engine being illegible to humans without the aid of an editor that does EBCDIC --> ASCII conversion on the fly.

    As for substitute, you should be able to specify hex values within "<<>>".

    For example: SUBSTITUTE(your object:fromcard, "<<B1>>","<<CA>>")

    Note to the intrepid -- I haven't actually tried this. :-)

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


  • 4.  Re: Convert function; pack decimal to ascii

    Posted 02/10/10 11:31 AM
      |   view attached

    Originally posted by: repanzer


    I can't believe I forgot about the <<>> in the substitute function, but, ironicly, the <<>> was the only thing that effected out upgrade from 7.5 to 8.1; one map would not come up in launcher unless I took out the substitute with the <<>>. When I run the map right now on my desktop.

    Anyway, no matter what I do to make this work, it's never 100%.

    I made my input type tree EBCIDC and an output ASCII blob and it works wonders for most records...until I hit an Hex 15 in ebcidic in a packed decimal field.

    (I attached a pic of the bytes)

    In the first example, it leaves the hex 02 24 0C packed decimal field as is when going to ascii, converts everything else fine. When I take that same data, make the hex 24 a hex 15, it converts it to a hex 0A (ascii LF). I do not know why it will leave the hex 24 alone, and not convert it to an ascii "4" (ascii hex 34), but insists on converting the hex 15 ebcidic to hex 0A ascii when the fields are defined the exact same way. I didn't change the type tree, I just make the hex 24 into hex 15 and it treated it differently.

    So does that mean I should do a substitute on all these field, leaving X'24 alone, but use substitute putting Hex 0A back as hex 15? Unfortunately I can't even test if that will work, because my map just shuts down. If I knew how to use the convert and alter the table, that may be a solution, but I don't know how that works and the docs do not provide enough info.

    Thanks for the input!
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Convert function; pack decimal to ascii

    Posted 02/10/10 11:50 AM

    Originally posted by: repanzer


    Whoops, I need to finish this sentance;

    "When I run the map right now on my desktop, the map just dies. No "illegal operation" mesasge or another, just boom, map designer closes.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: Convert function; pack decimal to ascii

    Posted 02/10/10 12:48 PM

    Originally posted by: repanzer


    I am able to use the substitute to convert the 0A back into x15, using the WTX "tag" things, so instead of;

    SUBSTITUTE(data, "<<0A>>", "<<15>>")

    I can use;

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

    I just highly doubt that every possible character used in pack decimal will have a "tag"..thing.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Convert function; pack decimal to ascii

    Posted 02/13/10 03:10 PM

    Originally posted by: repanzer


    I was able to achieve what I needed to.

    On my input, I leave all text fields as is, data language EBCIDIC. For Pack Decimal, I change them to “Text/Character”, which is the input type for the UNPACK function.

    On the output, the text fields are language ASCII, and I move text field (EBC) to text field (ASC), which converts perfectly, but I need to change the pack decimal fields to text/binary (instead of text/character), and I can either map the field as is and it will keep the hex as is, so now my output will have the pack decimal value, or, do;

    NUMBERTOTEXT(UNPACK(Field)) and it unpacks to the decimal value, so I have to expand the size of the fields.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender