IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
  • 1.  Zero filled numeric field mapping as NONE when using NUMBERTOTEXT in output

    Posted 3 days ago

    v11.0.2 running on Windows 11.

    Input filed is zero filled.  Output field is text.  The zeros don't map and the field ends up empty which results in invalid X12.

    Input filed ==> 000000000

    Output ==> ADX**K2 (element 2 is mandatory and I would expect zeros).

    Thanks.



    ------------------------------
    Steve Arbo
    ------------------------------


  • 2.  RE: Zero filled numeric field mapping as NONE when using NUMBERTOTEXT in output

    Posted yesterday
    Edited by Rich McFate yesterday

    Steve -- when an input field contains nothing but pad characters, as appears to be the case here, it evaluates to NONE.

    So what happens next depends upon the context of the output.  In the case of an ADX segment I'm looking at (5010), it comprises two required elements followed by a Ref# Composite, which is in effect two optional elements.

    So if you're mapping your NUMBERTOTEXT(<input field>) into ADX01 and "K2" into ADX02, I would expect to see exactly what you're seeing.  Mapping NONE into a required field will build the empty field.  Mapping NUMBERTOTEXT(NONE) will still be an empty field.

    If you need to see ' 000000000' in your output, I suggest:

    Either(NUMBERTOTEXT(<inputField>),"000000000")

    This is not in the spirit of the X12 standards, which are designed to eliminate all unnecessary characters, but I appreciate some ICs require it.

    Cheers,

    Rich



    ------------------------------
    Rich McFate
    ------------------------------



  • 3.  RE: Zero filled numeric field mapping as NONE when using NUMBERTOTEXT in output

    Posted 18 hours ago

    Rich's answer is spot on and what approximately what my advice also would be.  However in looking at context, I think you would want to suppress this whole segment if the number is all zeros.  K2 qualifier indicates a Certified Mail Tracking number.  If it is all zeros it is meaningless and probably should not be sent at all.  So in this case, I would have a functional map create the segment with the qualifier and the number so that if either aren't present (or in your case all padded zeros equating to not present), the whole segment would not be mapped.  Not sure what transaction you are working however so would not be appropriate if the segment was mandatory of course. My 2 cents anyway.

    Happy mapping!



    ------------------------------
    Lisa Edwards
    Software Engineer / Subject Matter Expert
    Rainbow Data Systems, Inc
    ------------------------------