cancel
Showing results for 
Search instead for 
Did you mean: 

csv bug due to CRLF

gino_babu2
Participant
0 Kudos

Hi Team,

We have an issue with csv file processing. We have a requirement to process the time stamps in the deliveries from an incoming csv file. We are using the fm tseg_write_update to update the delivery time stamps. But we have issues when there is crlf coming in the file without ;

For eg in a line if there is a time stamp entry "status unloading departure;2020.11.12 06:29:2020.11.17 13:25:03;CETCRLF"

then if we execute the program the program is resulting in a dump. In the debug mode we could find the CRLF is being interpreted as # character. Then we tried to process it by adding a ‹‹ ; ›› (manually)and found we were able to process.

The question is, is there anyway to add ‹‹ ; >> in the background before CRLF while processing the file or just remove CRLF from the file using coding?

Please let me know if any of you have encountered the same issue?

Regards

AW

Sandra_Rossi
Active Contributor
0 Kudos

CRLF represents the end of line. When you read the text file, READ DATASET should not store it in your variables. Or did you use IN BINARY MODE with OPEN DATASET? You should use IN TEXT MODE.

In debug, all control characters are displayed as #. But you can see their hexadecimal exact value (CRLF should be 000D 000A, or 0D00 0A00, depending on the endianness of your system i.e. as shown in SNLS, code page 4102 or 4103 respectively).

Note that your program should not trigger a runtime error, it should be robust enough to report any error to a log.

Maybe I didn't understand your issue, so please provide more details to continue the discussion.

Accepted Solutions (0)

Answers (0)