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

Flat File Delimiter Issue

  • 1.  Flat File Delimiter Issue

    Posted Tue February 25, 2003 11:24 PM

    I created a generic Flat File Schema template to test writing out a flat file that was fixed position. (columns 0-3 are id, 4-10 are data). I wrote it out (using the Sample.IO package file handlers, not the inherent, and as far as I can tell undocumented, outputFileName field in convertToString) to a file and everything looked fine. However, according to the ConvertToString documentation, I can set record, field, and sub-field delimiters. When I set these values in the ConvertToString flow, however, it doesn’t do anything. It’s the same output no matter what I put in these fields. Has anyone gotten these delimiters to work? If so, what do I need to do to get them to work? If I pass multiple records to convertToString, it handles it fine, except that it ignores my delimeters.

    Any help would be great! I’m stuck!

    Jamie Stanton
    Innotrac


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


  • 2.  RE: Flat File Delimiter Issue

    Posted Wed February 26, 2003 12:02 AM

    I believe you specify the delimiters in the template.


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


  • 3.  RE: Flat File Delimiter Issue

    Posted Wed February 26, 2003 12:42 AM

    Well, normally, there are two types of flat file formats, either fixed length (position-based) or delimited (with delimiter). If you want to output fixed-length file, you don’t need delimiters…will look at it later…


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


  • 4.  RE: Flat File Delimiter Issue

    Posted Wed February 26, 2003 06:53 AM

    You will find the answers to your questions in developer\plugins\flatfileplugin\doc\ISFlatfileSchema.pdf.

    If you are using 6.0.01 youwill find a shockwave demo file showing you (step-by-step) how to do what you are trying to do. Access to the demo is via the home page icon of the WmFlatFileSamples package under the Manager hyperlink of the Administrator Browser.


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


  • 5.  RE: Flat File Delimiter Issue

    Posted Wed February 26, 2003 04:49 PM

    Hmmmm… I don’t have the WmFlatFileSamples package, so I’m guessing I haven’t picked up 6.0.01 yet. I’ll look for that. From what y’all are saying, though, I’m guessing that I have to pick one or the other. Which is generally fine, with the exception of a record delimiter, which is quite useful even in fixed position formats by placing a newline after each record. I tried adding a “dummy” 1 character field to the record and defaulting it’s value to \n, but that didn’t work. I just got the "", it didn’t seem to want to read it as a single character. I can do it the hard way, looping and only ever passing 1 record to the convertToString method, but that seems limiting. Is there anyway that I can tell it to put a newline after each record of my fixed position flat file? Thanks for all your help!

    Jamie Stanton
    Innotrac


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


  • 6.  RE: Flat File Delimiter Issue

    Posted Wed February 26, 2003 06:43 PM

    \n is a special literal that is automatically converted to 0x0a by compilers and sometimes by services within the wM IS environment (e.g. convertToString will convert it when passed as one of the delimiter parameters).

    If you wish to use \n (or \r, \t, etc.) outside of these cases, you have to do the conversion yourself. Do a search in wmusers.com for “toChar” which is a service that will do this conversion for you. You can place the resulting char in your dummy record field.


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


  • 7.  RE: Flat File Delimiter Issue

    Posted Wed February 26, 2003 11:07 PM

    Thanks Rob! That did it. I added an extra field called newLine to my record that was 1 character long, used toChar and it worked great. Thanks everyone!

    Jamie Stanton
    Innotrac


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


  • 8.  RE: Flat File Delimiter Issue

    Posted Thu August 07, 2003 10:41 AM

    Hi! I was very pleased to read your messages here, I’m having the same problem: a flat file with fixed lenght, but after every record a carriage return must be added.
    What I did so far: in the schema I added a dummy field in each record, I filled this field with the outcome of the toChar service.
    This doe not work for me??
    Any suggestions?


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


  • 9.  RE: Flat File Delimiter Issue

    Posted Fri August 08, 2003 03:24 AM

    Claire, if you are using the schema editor in wm 6.01, try this.
    on the Flat File Definition tab
    under Record Parser select Delimiter
    Under Record select Character and in the selection box select Newline from the drop down.


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


  • 10.  RE: Flat File Delimiter Issue

    Posted Fri June 03, 2005 02:17 PM

    Hi ,
    I am facing the opposite problem… I have my record parser as Delimiter. The record delimiter that I am using is a newline. However, the convertToString service is adding an extra delimiter to all my records…i.e, all the records are separated by two newlines. Help me out!


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


  • 11.  RE: Flat File Delimiter Issue

    Posted Fri June 03, 2005 03:05 PM

    Salonia,

    Did you tried with carriagereturn as well?,unless you set extra delimiter convertToString dont add extra delimiter.Please make sure.

    HTH,
    RMg


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


  • 12.  RE: Flat File Delimiter Issue

    Posted Mon June 06, 2005 04:51 AM

    Hi rmg,
    Yes, I tried with carriage return, but that too did not work. I have not added extra delimiter anywhere, just defined the delimiter once in the schema. Is this some bug with convertToString…??
    Saloni


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


  • 13.  RE: Flat File Delimiter Issue

    Posted Mon June 06, 2005 08:34 PM

    Are you moving the file between Unix and Windows?
    Take a look at the file in an Hex editor like debug on windows or Ultraedit. You probably have embedded carriage return/line Feed in the file.

    hth


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


  • 14.  RE: Flat File Delimiter Issue

    Posted Wed July 25, 2007 04:48 PM

    I need some help. I´ve created a flat file schema but I still have delimiters problems.

    I need to retrieve some data (for exemple: 001) after a specific string : order 001

    Remembering that I have an amount of data together : id 102 order 001 date 230407

    Any ideas how to do it?

    Thanks


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


  • 15.  RE: Flat File Delimiter Issue

    Posted Wed July 25, 2007 05:09 PM

    Please elaborate more about your FFSchema details?? Is your flatfile is fixed-length and delimited?? If it is fixed length you can specify start/end positions and extract the value??

    HTH,
    RMG


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


  • 16.  RE: Flat File Delimiter Issue

    Posted Wed July 25, 2007 05:14 PM

    Hi,

    It´s delimited. I cannot use fixed-length because the amount of data could be variable. I believe the solution is getting the data after an specific word. :frowning:


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


  • 17.  RE: Flat File Delimiter Issue

    Posted Thu July 26, 2007 03:58 PM

    Vivian,

    Will the data always appear in the same location? For example, in the sample you provided: id 102 order 001 date 230407

    id comes first, order comes second, and date comes third. Will that always be the case?

    If so, then you could use a flat file schema with a delimiter (a space, it appears) and then always assume that the 4th field is the order ID (in this case, 001).

    If not, then I don’t know that using the flat file schema to break down the fields will really buy you much. You might be better off just reading each line, passing the entire line to the service pub.string:tokenize, and then loop over the tokens. Once you find the token that you’re looking for (in this case, the word order), you can assume that the next token is the value you need.

    Let me know if this makes sense.

    • Percio

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


  • 18.  RE: Flat File Delimiter Issue

    Posted Thu July 26, 2007 05:19 PM

    Hi Percio! How u doing?

    Perfect! That´s the idea! I´ll try this using pub.string:tokenize!

    Thanks a lot!
    Vivian


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


  • 19.  RE: Flat File Delimiter Issue

    Posted Thu July 26, 2007 05:39 PM

    But if you use pub.string:tokenize then you got to do lot of manipulation to extract the values incase you file has lot of rows/lines…its ok if you are satisfied doing this.just curious.

    Is this solution not feasible for you ie. to put in the Schema side which was told above??
    "id comes first, order comes second, and date comes third. Will that always be the case?"

    HTH,
    RMG


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


  • 20.  RE: Flat File Delimiter Issue

    Posted Thu July 26, 2007 05:44 PM

    Hello,

    Data does not appear in the same location. But now… how to specify the string I´m looking for?

    Tks
    Vivian


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


  • 21.  RE: Flat File Delimiter Issue

    Posted Thu July 26, 2007 05:55 PM

    “how to specify the string I´m looking for?”

    What are you looking for?? specfying inString for the tokenize?? you got to do tricky for it. like first replacing linefeed in your file etc…and make as one big string …its a tedious process though…

    -RMG


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


  • 22.  RE: Flat File Delimiter Issue

    Posted Thu July 26, 2007 07:22 PM

    No…

    I have already a stringlist, after using the pub.string.tokenize. Now I must search in this results (0,1,2…) util find the word ‘date’ in some of this fields.


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


  • 23.  RE: Flat File Delimiter Issue

    Posted Fri July 27, 2007 02:37 PM

    One solution:

    1. Set a variable (ex. found) to false
    2. Use a LOOP to loop over the string list
    3. In the loop, use a BRANCH statement to check if ‘found’ is true
    4. If found is ‘true’, then it means that the current string in the list is the value you want. Map the string and EXIT the loop
    5. Still in the loop, use another BRANCH statement to see if the current string in the list is the label you want (ex. order). If so, then set ‘found’ to true.

    Does this make sense?

    • Percio

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