Carriage returns removed on iSeries

Hello everyone,I’m trying to create a file in the IFS of my iSeries.

In this file, I want to have the content of three fields of an email.

Everything is OK on a Windows server but I have to convert from EBCDIC to ASCII the content of the file.

Here is a sample of the code :

Open fileName$ For Output As fileNum% Charset=“ascii”

Print #fileNum%, mail.dspFrom(0);

Print #fileNum%, mail.Subject(0);

Print #fileNum%, plaintext;

Close fileNum%

It works but all the carriage returns are removed ! The content of the file is a simple big line !

The same agent on the Windows Domino server runs perfectly and the carriage returns are preserved.

Anyone had an idea to preserve carriage returns ??

Thank you for your help.