|
Hello Thomas,
For (1) -- I agree that it is crashing, but I do not see any mistakes? It looks to me like the fgets() routine from IBM does not work for Unicode data where the line ends in LF. (I tried different settings for CRLN= on the open, that did not help.)
I am working on rewriting CSVR4 to use the Unix-type open(), read(), lseek() and close() APIs instead of the POSIX C fopen(), fseek(), fgets() and fclose() APIs to solve this problem. Since the Unix-type APIs do not do any sort of buffering or have the ability to read according to text-file lines, I will need to write that functionality myself. It may take several hours, but I'll let you know when it is available.
For (2) -- you are correct. Thank you for finding that! However, it is not necessary to set peFldData = '' (it is already cleared a few lines earlier). Your fix would be simpler as follows:
if max > 0;
%len(peFldData) = max;
%subst(peFldData:1:max) = myEbcData;
endif;
On 5/6/2020 1:47 AM, Thomas Raddatz wrote:
Hi Scott,
Very fast reaction and good job. This is truly what I think and no ironie dspite the two errors I found.
1) CSVR4 crashes when called for a CSV file with line delimiter LF.
2) CSVR4 crashes when fields are empty.
I fixed the second problem with the following code snippet, applied 4 times in CSVR4:
if max = 0;
peFldData = '';
else;
%len(peFldData) = max;
%subst(peFldData:1:max) = myEbcData;
endif;
The first problem waits for being addressed.
CSVDEMO4 is great and I am sure it will help Greg.
Regards,
Thomas.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.