I have an ASCII Text File in the IFS (Code Page 819) populated by
CPYTOIMPF. A feature of this command is that line endings CR & LF are
created (ASCII 0D & OA). However, this creates a null line at the end of
the text file caused by the LF on the final 'real' line. The lines in
this file are in variable length CSV format and the file will be sent to
the Wintel platform.
Looking back through the archives shows a number of postings on this
topic and suggestions on how to resolve the problem. One way that I'm
following, is to remove the CRLF from the final row but my question is
how to achieve this using a combination of RPG and QC2LE APIs?
So far, using RPG, I have been able to replace the CR & LF by 2 null
(00) bytes by using a combination of the lseek and write APIs. Lseek is
used to get the offset of the CRLF bytes for the last line and write to
replace the CRLF with nulls. This works in as much as I lose the null
line but, ideally, I would like just to delete the CRLF from the final
line rather than replace it but I'm not sure if this is possible?
It may well be that my replacement with double null will work for the
Wintel application but, due to certain factors, I'm unable to test that
The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
Authorised and regulated by the Financial Services Authority.
This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate.
This thread ...
Re: One function to Trim and Edit a number., (continued)
This mailing list archive is Copyright 1997-2019 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