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

XML template for positional flat files

  • 1.  XML template for positional flat files

    Posted Wed June 04, 2003 03:12 PM

    Hi all,

    I need to create a flat file and defined a template to drive the data.
    The record structure I created look like this:
    rec0
    rec1
    rec2
    rec4
    rec9
    The rec2 and rec4 are sub-records and are in the same ‘level’ inside rec1. The rec1 and rec4 are record lists.
    The generated flat file look like this:
    0datadatadata
    1datadatadata
    2datadatadata
    4datadatadata
    4datadatadata
    .
    .
    4datadatadata
    9datadatadata
    The issue is that rec1 can have no data sometimes, and when it happens I append rec4 in an empty rec1, but when convert this record into flat file, the flat file shows up with a blank line right before the ‘4datadatadata’ line.
    How should I define my template to skip the empty rec1 when it happens?

    Thanks in advance,
    Maldonado


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 2.  RE: XML template for positional flat files

    Posted Wed June 04, 2003 06:25 PM

    Renato,

    I could be wrong but I think you’re getting the correct behaviour from the template. The first record is either populated or its not. You might have to write some external service to strip off blank records.
    If i’m off base hopefully someone else will chime in with the correct answer.

    Good Luck!


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: XML template for positional flat files

    Posted Wed June 04, 2003 06:56 PM

    Hi Chris,

    Thanks for your feedback!
    This was the workaround that I was thinking to do to solve it.
    Since I’m a quite new on flat files, my hope was that there was a occurrence indicator, just like ‘,’ (comma) indicates repetition, that could help me indicating an optional segment. By the way, I tried ‘*’ (asterisk) and got the same result.

    Thank you anyway


    #edi
    #webMethods
    #Integration-Server-and-ESB