Still the sam problem with the csv file.

make

Member
Hi good morning:
I still have the same problem with the result of my propgress code:
i create a CSV file with the following line:

First the Def:
output stream strOut to value(cOutFile) append no-echo keep-messages CONVERT TARGET "iso8859-1".

Then the call :
export stream strOut Delimiter ";" Xaufpos.kdnr String(Xaufpos.vanr) String(Xaufpos.aarnr) string(Xaufpos.posnr) ~
string(Xaufpos.pposnr) string(xaufpos.wdat,'9999-99-99') Xaufpos.komm Xaufpos.bem Xaufpos.glasbez string(Xaufpos.durchm) Xaufpos.richtg ~
string(Xaufpos.Spha) string(Xaufpos.tor) string(Xaufpos.achse) string(Xaufpos.addition) ~
string(Basiskurve) String(Basislage) string(Xaufpos.farbe) string(Xaufpos.fproz) string(Xaufpos.ets) Xaufpos.sondfert xaufpos.posstat string(xaphist.Datum,'9999-99-99') ~
xaphist.Zeit xaufpos.herkunft string(xaufpos.anldat,'9999-99-99').

Everything works fine, but the last line in the created file is always empty. I cant use this file with an emty last line.
I cant use the transaction command because there is no repeat in my code.
My idea : is there a way to kill the last empty line after i have created the file. I believe that, but i have no idea how i cna do that.

Pleaseeeee! need help

Make
 

bendaluz2

Member
Try this

<pre>
output stream strOut to value(cOutFile) append no-echo keep-messages CONVERT TARGET "iso8859-1".

put stream strOut unformatted
Xaufpos.kdnr ";"
String(Xaufpos.vanr) ";"
String(Xaufpos.aarnr) ";"
string(Xaufpos.posnr) ";"
string(Xaufpos.pposnr) ";"
string(xaufpos.wdat,'9999-99-99') ";"
Xaufpos.komm ";"
Xaufpos.bem ";"
Xaufpos.glasbez ";"
string(Xaufpos.durchm) ";"
Xaufpos.richtg ";"
string(Xaufpos.Spha) ";"
string(Xaufpos.tor) ";"
string(Xaufpos.achse) ";"
string(Xaufpos.addition) ";"
string(Basiskurve) ";"
String(Basislage) ";"
string(Xaufpos.farbe) ";"
string(Xaufpos.fproz) ";"
string(Xaufpos.ets) ";"
Xaufpos.sondfert ";"
xaufpos.posstat ";"
string(xaphist.Datum,'9999-99-99') ";"
xaphist.Zeit ";"
xaufpos.herkunft ";"
string(xaufpos.anldat,'9999-99-99').
</pre>
 

Crittar

Member
Make,

You say the output is not in a repeat but your post implies you are expecting more than one record to be output to the file.

What kind of loop is the export statement in?

You could try:

Code:
OUTPUT STREAM strOut TO VALUE(cOutFile) APPEND 
  NO-ECHO KEEP-MESSAGES CONVERT TARGET "iso8859-1".

DO TRANSACTION:

  EXPORT STREAM strOut Delimiter ";"
    Xaufpos.kdnr 
    STRING(Xaufpos.vanr) 
    STRING(Xaufpos.aarnr) 
    STRING(Xaufpos.posnr) 
    STRING(Xaufpos.pposnr) 
    STRING(xaufpos.wdat,'9999-99-99') 
    Xaufpos.komm 
    Xaufpos.bem 
    Xaufpos.glasbez 
    STRING(Xaufpos.durchm) 
    Xaufpos.richtg
    STRING(Xaufpos.Spha) 
    STRING(Xaufpos.tor) 
    STRING(Xaufpos.achse) 
    STRING(Xaufpos.addition)
    STRING(Basiskurve) 
    STRING(Basislage) 
    STRING(Xaufpos.farbe) 
    STRING(Xaufpos.fproz) 
    STRING(Xaufpos.ets) 
    Xaufpos.sondfert 
    xaufpos.posstat 
    STRING(xaphist.Datum,'9999-99-99')
    xaphist.Zeit 
    xaufpos.herkunft 
    STRING(xaufpos.anldat,'9999-99-99').

END.
:)
 

Dan Dragut

New Member
I guess it was the DO TRANSACTION: one...

I have used almost the same form (REPEAT TRANSACTION) for an IMPORT and it worked just fine, no blank record at the end.
 
Top