I have not written much about using FTP on the mainframe, but I often get questions regarding FTP so now it is time for some information. Links to the manual about FTP you will find in the preceding tip about FTP. Today most mainframe installations are using the IP transmission protocol instead of SNA and transmission of data is consequently done using FTP between mainframes. This leads to some challenges which I will walk through here.
FTP transmissions are traditionally used as transmission of data between the mainframe and ASCII based platforms. In such transmissions character translations plays an important role. Character translation is avoided by using the FTP command BINARY before transmissing any data. Default for any FTP session is to perform translation between ASCII and EBCDIC. Another sligthly neglected translation is conversion of records into carriage return (cr) / line feed (lf) and vice versa. All files on the mainframe are composed of records and blocks while files on ASCII based platforms are considered to be one long character stream.
Unfortunately the development people behind FTP on the mainframe missed this detail. Therefore you will at some point in time discover that the file you transmitted from mainframe site A to mainframe site B has been changed even though it should not have done so. The reason is that the FTP command interprets certain EBCDIC characters as cr/lf. Those characters very seldom appear in our datasets and FTP seems to be working fine for a very long time. Then some day it ceases to work fine and you do not undestand anything of what has happened.
At such incidents I become involved. The cure is to use one of the FTP commands RECORD or BLOCK before the actual data transfer. Even though it is not stated in the manual I am convinced that these two commands work in exactly the same way and produces the same result. I have not found any differences. After issuing one of these commands FTP will ignore any EBCDIC cr/lf representations. RECORD and BLOCK are by the way relatively new commands. STRUCTURE RECORD may be used instead of RECORD and MODE B instead of BLOCK. After this you will be able to transmit datasets without any changes as long as the two mainframe sites uses the same EBCDIC character set or you use the BINARY command.