Open zippy1981 opened 8 years ago
IBM EBCIDIC code page does not match the encoding tables with ASCII, and to avoid future problems of her conversion, activate the transfer of all files as Binary. When you send a file as a Pline/Text FTP adds the symbol of the End of File (EOF, CtrlZ) which leads to its deterioration.
All transactions conversion of downloaded files when working with the IBM OS/360 - OS/370 - AS/400 - AIX - OS/390 must be carried out only as a local copy there is a nonzero probability that the intermediate nodes of the network and do try to "correct errors" if the files are transmitted as Plain/Text. It all depends on their configuration. If the file is transferred in BINARY mode, the intermediate network nodes do not change it, and no data is lost.
@VictorVG Are you saying the server will choke on the EOF character when converting back from ASCII to EBCIDIC?
I see two problems with directly editing EBCIDIC files at the moment"
In our case, if we pass the remote server command "type image" (see. RFC959) command to "get/mget file / files "the FTP protocol does not change its / their structure considering binary files, and you have log (see. timestamp. 01/22/2016 22: 53: 17.277) worth recording. "01/22/2016 22: 53: 17.277 Ascii transfer mode selected" - files are transferred in ASCII mode in which the end of each file appended to the symbol EOF, symbols of Cr (Lf ) transfer lines do not change.
What we need to solve the problem?
1) Set up a connection to the BINARY mode the files came "as is" - today NetBox no support other code pages other than 866/1251/20866/65001, so all you need to perform a text-editor;
2) The task of reformatting lines simple enough and can be easily solved or Lua script or plugin AutoWrap distribution of Far Manager.
3) The problem of conversion is achieved either as "open text editor and save to change the encoding of ShiftF2" TextConv or plugin which is able to change the encoding, line breaks, replace the tabs with spaces and remove blank lines at the end of the file.
In other editors their money, but there is no reason to use for this simple editors like ee, ed, edit, notepad - they do not have many tools as they are designed to solve basic problems, and viewing of text.
You brought up some great points, and someone else brought up another good point, that if I ever have source members that aren't US English, ASCII transfer will lose data.
I think its best if I configure ESC to load .MBR files as wrapped at 80 charcters and EBCIDIC encoded.
Just upload, such as binary files and will not lose data. Why did you decide that the inside of the container are stored text data to be recoded? And if your assumption is incorrect? After all, unless you have received from a remote host file and not seeing the structure you do not know what's there. This in Windows from the existence of a set of conventional rules that the suffix "extension" definitely compares the contents of the file and the application handler, and UNIX, IBM OS/360 (OS/370, OS/390), this rule was not, and hopefully never will be. There is the concept of "access rights" - RWX - Read -Write-Execute and "Protocol" defines the application processor, depending on the structure of the file, and he can have any name which is part of the suffix name is used to uniquely identify a particular data set .
Why did you decide that the inside of the container are stored text data to be recoded?
Two reasons.
First of all, by design of the FTP server on OS/400, when you download with ASCII, it converts the members from EBCIDIC to ASCII. When you upload it converts from ASCII to EBCDIC, removes the newlines, and pads each line to 80 characters.
Secondly, the first time I opened the file after BINARY transfer and set encoding to EBCDIC I got all the text on one line. and lots of spaces. After ASCII transfer I got newlines and no spaces.
Two reason it is certainly powerful,:) but what about the loss of data? You yourself hopelessly corrupt files willed designated, he alleged properties and then refuse to knowingly use safe methods to test your conclusions. If the file uses a non-ASCII encoding, the same character "!" in character sets HP EBCDIC, IBM EBCDIC, EBCDIC AT & T have different values: ASCII - 0x21, HP EBCDIC - 0x4F, IBM EBCDIC - 0x5A, EBCDIC AT & T - 0x5A, and he is not the only plus to the second part of the table with addresses from 0x80 is national symbols and that you are there to encode one case is known ...
Just use VEDIT for EBCDIC files.:)
The FTP server in question is PUB1.DE an iSeries server running OS/400. Accounts are available for free and I'll gladly assist reproducing the issue.
My transfer mode is set to AUTO. The file on the server is EBCIDIC encoded, but if I perform an ASCII GET or PUSH it will translate the file to and from ASCII. If I select one of these files (a source member in the parlance of the server OS) and hit F4, an ASCII download is initialted, and the file is translated. However, when I save the file in the editor, it does an IMAGE or binary transfer and the operating system cannot read the resulting file.