webMethods

webMethods

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

Flat file schema definition

  • 1.  Flat file schema definition

    Posted Thu August 19, 2004 03:08 PM

    Hi All,

    I am trying to create a dictionary for a flat file of “fixed length”
    format, where one of the fields is of one character length.

    If I specify the Start and End position to be the same, Developer
    doesn’t allow me specifying that the End position must be greater than
    the Start position.

    Anyone knows how to work around this? One I can think of is to let it
    take two characters and strip that second character inside the code.
    Haven’t tried this, but assume that it will work. But am looking for a
    more straightforward solution.

    Thanks,
    Gowri.


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 2.  RE: Flat file schema definition

    Posted Sat August 21, 2004 05:04 PM

    Hi Gowri,

    Java substring operations (which underpin webMethods String handlers) use zero-based counting and the “end” position you give is non-inclusive - that is, it is the location of the first character to NOT include in the substring extraction.

    That means to extract the second character from a string, you would use a start position of 1 and an end position of 2 - this means everything from character position 1 up to and NOT INCLUDING character position 2.

    e.g. webMethods - start location 3, end location 4 = “M”

    This is why the start and end locations cannot be the same.

    Page 56 of the Flat File Schema Developer’s Guide (FlatFileSchemaDevGuide.pdf) explains fixed-position extraction like this:

    Fixed Position. Counting from zero (0), extracts a fixed number of characters from a
    record.
    ! Start Position. First character to extract from the record.
    ! End Position. First character that is not included in the extraction. If you enter a
    negative number (for example, -1), the extractor returns all characters from the
    character specified in the Start Position to the last character in the record or
    composite.
    For example:
    record = webMethods
    Start Position = 1
    End Position = 7
    Extracted characters = ebMeth

    Hope this helps.

    Cheers,

    Steve Ovens
    webMethods Professional Services
    Melbourne, Australia


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB