Re: 4gl writing to a pure text file
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion
Keith Root (keithr@winternet.com) wrote: : I have the need to create a flat ascii file for an off line application. : The file is fixed length, 192 characters. : What is the easiest/fastest way from a 4gl program to write to an ascii text : file? I have come up with some of the following. : 1. use the run command to echo >> filea - after formatting rows : 2. create table with 1 column (192 char) and format a variable in the 4gl : code and update/insert - unload and strip "|" (2 passes - seems messy) : can someone point me to doco (4GL - 4.01) or have any ideas?? Keith, Do it with a report. Just set the lines per page to 1 and the margins appropriately. We use this in our conversion programs all the time. One thing you have to be aware of is when the report is "finished" you will get one blank line at the end. You can suppress this by getting a count of rows within the report and using a print statement with a semicolon for the last row. If you need some sample code e-mail me at mfw@servantis.com ... Milt Webb -- ------------------------------------------------------------------------------ Milt Webb | email addresses> miltwebb@netcom.com Servantis Systems, Inc. | mfw@servantis.com 4411 East Jones Bridge Road | mfw@atl.fujikura.com Norcross, GA 30092 | Phone 404/840-1365(W) or 404/945-5896(H)