Hi Scott,
I needs to be able to receive ASCII data into a
file with a ASCII code page.
As per your suggestion I changed the FTPAPIR4
Opnfile procedure to use the EBCDICF_cp in stead of the DFL_LOC_cp. Then I
precede the FTP_GET with a FTP_Codepg(437:437).
This all runs well. The file is created with
codepage 437, and the data is written in codepage 437.
There is just one snag (there always is, isn't
there..). What happens is that the x'25'
characters are removed from the received data stream.
I have found why and determined how to fix this.
Could you please verify this solution and possibly, if correct, integrate
this into the next release of the FTPAPI, or if not correct (it might break
backward compatibility) propose another way to fix this problem?
The Get_byline procedure contains code to convert
the wwCRLF field from EBCDIC x'0D25' to ASCII, using the ToASCIIF procedure.
Since I precede the call to FTP_GET with a call to FTP_Codepg(437:437)
this does not translate anything, and the code that follows will therefore
treat the x'25' character as a LF. This results in missing % (percentage sign)
characters which happen to be x'25'.
Since the Get_byline code does a ASCII type of
FTP_GET, the program should just use the plain x'0a0d' ASCII codes
without translation, as per the FTP RFC, instead of translating the EBCDIC
x'0d25' to the current ASCII codepage.
Kind regards,
Loek Maartens,
Veracity Software Consultancy BV
|