IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Creating templates for positional flat files

  • 1.  Creating templates for positional flat files

    Posted Thu December 05, 2002 11:38 PM

    I am trying to convert a flat file to XML template to Record structure by following the directions in the EDI Adapter User’s Guide. I have a positional flat file with SEGMENT ID combinations more than I would like to code for. In addition, I have one trailer at the end of the flat file with a SEGMENT ID of ‘T’. The trailer record contains a total record count of the flat file. All I care to do is to count the actual number of records (excluding the trailer) in the flat file and extract the count value of the trailer record and compare the two values. I am using “recordsWithNoID” as the SEGMENT ID for counting of the flat file records because there are too many SEGMENT IDs to account for (plus I don’t know all of them). The other SEGEMENT ID is ‘T’ for the trailer. When I run my service, the ‘T’ SEGMENT ID returns a value, but the “recordsWithNoID” is not recognized, nor created and probably under udDefData. When I change “recordsWithNoID” to a SEGMENT ID that I know exists, then I get values from the flat file in my record structure. The only segment that I care to describe is the ‘T’ segment because I am pulling a value out of it. I am accounting for everything in the record reference.

    An example is something like this:

    (flat file)

    SHCT1111
    CCWY1111
    THVL1111
    PCVG1111
    T00019

    (Flow Service)

    map (pass in flat file)
    stringToDocument
    documentToRecords
    convertToValues

    I really want to use the flow services for this solution, but not tied to it. I am ready to write a java service if I have to. Any suggestions would be helpful.

    Thanks, Robby


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Creating templates for positional flat files

    Posted Fri December 06, 2002 02:21 PM

    Are you using a template? If so could we take a look at it?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Creating templates for positional flat files

    Posted Fri December 06, 2002 03:08 PM

    This is the template I am using. I am not describing the details for SEGMENT ID ‘recordsWithNoID’ because I don’t need the details for anything. I just care to count how many instances of ‘recordsWithNoID’ For SEGMENT ID ‘T’, I am extracting a value for Records starting at position 13.

    10


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: Creating templates for positional flat files

    Posted Fri December 06, 2002 03:38 PM

    This is my template

    <?xml version="1.0"?>

    10

    <OFFSET></OFFSET> 
    

    <OFFSET></OFFSET> 
    

    <OFFSET></OFFSET> 
    
    <POSITION NAME="Records" START="13" LENGTH="5"/> 
    

    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB