IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
Expand all | Collapse all

CRLF embedded in an X12 output

  • 1.  CRLF embedded in an X12 output

    Posted Wed May 27, 2015 05:50 PM

    Originally posted by: Shane.kelly55


    Hey Guys,

    I'm updating someone else's code and i see the following:

    =VALID(RUN ( "M:\WTX\port\ics\bin\mmc\MOVE.mmc", "-WM -P128:16 -Y3:1 "

        + ECHOIN(1, PACKAGE(WriteFile)) 
        + " -OF1R3:1B " + PathFileNM), 
        VALID(PUT("FILE", PathFileNM, PACKAGE(WriteFile)),
      FAIL("Failure on WriteFile (" + LASTERRORCODE() + ") " + LASTERRORMSG())))

    I am outputting to an X12 file but rather than have the output in one long string in the X12text file i'd like to have the X12 segments terminated so its formatted and easier to read.

    I'm not even sure if the above is where i accomplish this but any help would be appreciated.  I cant seem to find what alot of the above switches even do.

    Thanks

    Shane


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


  • 2.  Re: CRLF embedded in an X12 output

    Posted Mon June 01, 2015 04:55 PM

    Originally posted by: Tim Rabbitt


    Hello Shane:

    Based on what I see, the map is simply copying a file to another location.  It's taking the entire contents of WriteFile and saving it.  You would need to parse the original data, WriteFile.  In the data, there must be some sort of delimiter that you could use to determine where CR-LF's could be inserted.  You would have to use that delimiter to detect individual segments on input and then using those individual segments, generate the output using a delimiter (terminator) of CR-LF on each segment.

     

    Regards,

    Tim Rabbitt


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