I’m creating a file using pub.flatFile.convertToString. It is a fixed-length record file and everything is created fine except for the record delimiter. I’d like to use a CRLF (hex’0D0A’) as the record separator, but when I follow the instructions in the Flat File Schema Developer’s Guide, version 6.1, I only get a CR (0x0D).
On page 82 of that guide, in the Description for the record variable in delimiters, it says: “If you want to specify the two-character carriage return line feed (CRLF) characters, specify \r\n”.
I’m running IS 6.1 with SP1 & SP2 on a Windows machine and wondering if there is a Windows setting that is maybe translating the \r\n into a CR, or if the convertToString service just doesn’t work as advertised.
Does anyone have any experience with this problem?
Thanks for any ideas,
If you edit your flat file schema in Developer and select ‘carriage return line feed’ from the list as your record delimiter it should work. I just verified this with one of my own schemas and I had 0D 0A when I viewed the output in a hex editor. Sometimes moving files between Unix and Windows or using a text editor that does a conversion on line terminators can muddy the waters here. HTH,
Sorry, I missed that you were using a fixed length record. Perhaps this thread will be of some use: [url]wmusers.com
In the Schema, I changed the Record Parser to “delimiter” and set the Record character (delimiter) to “carriage return line feed” like you suggested in your first response, and removed the record delimiter setting on the call to convertToString, and sure enough it worked! The fields in the records are still fixed length and not delimited, but I guess since the records needs a delimiter then that’s the way to do it.
Thank you very much, I don’t think I would have thought of that. And I guess I shouldn’t expect the documentation to always be correct. I opened a service request with webMethods about the documentation to see what they have to say, but haven’t heard back yet.
Thank you very very much,
If your requirement is to have “carriage return line feed” as the record delimiter and some other character (e.g. “,”) as the field delimiter then in your FFTSchema also set the Field or Composit Char to ,.