Output to Flat file

Jamie_Yates

Active Member
Hello All

My problem is that I want to output fields from a table into a flat file (its F04572OW for bank payments), I usually use B34A1010 to output each line, but the german file cannot include carraige returns, which B34A1010 inserts.
Does anybody know of a way of either, removing the carraige returns or a business function that will output a string to a flat file and not append a carraige return.

I though of concatinating all the data into one valiable, but it is impossible to know how long the string will grow.

Please help, it driving me mad

Regards
Jamie
 
Know any good scripters at your place there? You could use your normal methods of outputting flat files, including the Endlines. Then when it's done, you could use the business or system functions for launching external apps to call a Perl script that you've written to parse out all the CRLF's and replace them with nothing.
 
Hi Jamie,

I had the same problem, I created a new BSFN but for example a copy of B34A1010 would do or add a function like WriteOneLine to this .

In B34A1010 search for:
fprintf(fpOutFile, "%s\n", lpDS->szRecord);


This should be changed to:
fprintf(fpOutFile, "%s", lpDS->szRecord); (\n removed - this is the new line character in C)

Goodluck!
 
Thanks for your reply

I tried exactly what you said but ran into problem since I have no experience writing C business functions.

I created a c business function and then created it. I copied the B34A1010.c and .h files over the top of the new files and edited these files the best I could. But when I tried to use the function I got an error.

Do you know of any documentation that show you how to achieve this.

Kind Regards
Jamie
 
Thanks for your reply,

I was trying to avoid using any programming outside of OneWorld, but it something I may have to fall back on.

Thanks for the help
Jamie
 
It may not be elegant but it is current. http://asktom.oracle.com had yesterday (22/10/02) a link to a flat file export sql and command file set which you can tweak to format the output how you like. Originally set up for csv file output its about 10 lines in total and might do the job.
 
I've managed to get it working, fantastic!!!

Thanks for your help

Regards
Jamie
 
What also might help is to program first statements in NER and then have a look how the function is build in C. Although the genrated code is not always that readable because of the code generator assign the C variables, but get used to this and it helps.

Bregards,

John
 
Use the Business Function Strip Hex and Blanks. Of course before using this replace Blanks first with unique character to prevent from striping them. The Carriage return will be stripped out.
 
Back
Top