Answered Delimiter option in EXPORT statement

Hello,

I was looking on the export statement and the delimiter option. Is there a way to put the delimiter value as variable:

Code:
DEFINE VARIABLE toto AS CHARACTER .

define TEMP-TABLE TT1
    field myValue as character .
    
toto = "," .

FOR EACH TT1 no-lock :
EXPORT DELIMITER toto TT1 .
END.

Like this I can ouptut a delimiter specific to a system like USA or EUROPE .

Best Regards,
 

Stefan

Well-Known Member

DELIMITER character
The character to use as a delimiter between field values. The character parameter must be a quoted single character. The default is a space character.
If you specify more than one character as a delimiter, ABL uses the first character as the delimiter.

So the short answer is no.

You can write a resuable dynamic version of export that can be used for everything, but will need to take care of all the nasty stuff like escaping, extents and crlf.

If you only need comma or semi-colon you could just hard code copy them all over the place.

Alternatively, you avoid character separated formats entirely and use json or xml in which these ambiguities do not exist. Depending on the consumer of your file this may not be an option.
 
Top