Total Commander FTP Bug?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Total Commander FTP Bug?

Post by *tony01 »

Hi :

I have total commander 6.53, and use FTP to download files from Mainframe to PC, modify them and upload to mainframe again, all the files are cobol programs.

Last days I noted some programs that downloaded and uploded with total commander didn't work properly producing different result in the reports .

After analyzing the problem, I found that Total Commander didn't converted properly an special character '^' that used in the cobol program instruction.

Instruction from Mainframe:
INSPECT WS-PRINT-LINE REPLACING ALL '^' BY SPACES.

When I downloaded the cobol program to pc ,Total commander converted it to :
INSPECT WS-PRINT-LINE REPLACING ALL 'µ' BY SPACES.

Then when I uploaded from Pc to Mainframe , Total Commander converted to:

INSPECT WS-PRINT-LINE REPLACING ALL '5' BY SPACES.

Then, when the cobol programs were running in production I got a serius problems, because the program was producing bad information in the reports, and creating BAD DATA in files, and I was in seroius troubles.



Mr Ghisler can explain what is the problem with the FTP ?


I use this config, in wcx_ftp.ini file:


[MVS_in_Bytes]
Template1=- YYYY MM DD SSSSS=56664 d=O n*
Template2=nnnnnnnn YYYY MM DD hh mm SSSSS=72
Template3=nnnnnnnn YYYY MM DD
Template4=- n*
Template5=nnnnnnnn
host=11.6.162.54
username=user1
password=*****
localdir=C:\
pasvmode=0
keepalive=90,NOOP
hosttype=MVS_in_Bytes


[mod]Just in case you posted your real encoded password, I asterisked it out. Never post even an encoded password - it's easily decodable.

Hacker (Moderator)[/mod]
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, Tony.

Using FTP between Mainframe and PCs often is a problem. The reason is that Mainframes often use the EBCDIC character set, whereas Windows and Unix systems use ASCII/ANSI character sets.

A standard FTP client, like the one built into TC, does not know anything about EBCDIC/ASCII conversion.

This conversion either has to be done on the mainframe side by its FTPD (ftp daemon) or by a particular ftp client on the PC side.
E.g. the client software for AS400, Client Access, had its own transfer module, which took care of the required conversion form EBCDIC to ASCII and vice versa.
As far as I remember current FTP daemons on AS/400 e.g. take care of the conversion EBCDIC/ASCII during an ftp transfer PC <=> AS/400.

The only conversion that TC can do during a transfer is
  • Textmode: CRLF will be converted to LF when transferring to a Unix system
  • Textmode: LF will be converted to CrLF when transferring from a Unix system
  • Binary: no conversion whatsoever is carried out
Kind regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Post by *tony01 »

The author, should write a warnning in the manual saying that FTP doesn't take care of the conversion EBCDIC/ASCII during an ftp transfer PC <=> Mainframe (OS390/AS400). In the Manual I didn't find anything about this.
Otherwise the normal user, like me will not be aware about this big problem, that will cause Total Commander FTP.

Thanks
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Honestly I don't think in this instance this is the author's problem, or even a lack of documentation problem.

Doing a quick google search on FTP EBCDIC
gets me this page as the second link: File Transfer Protocal

If one doesn't put the FTP client specifically into EBCDIC mode then the client wouldn't be expected to handle that character set intuitively.

Doing a bit more detailed search I can't even find a client that lists EBCDIC support from a google search, maybe docs on individual programs do.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Yep, FTP is a Unix "child" as far as I know.

Unix systems do not know EBCDIC.
So FTP never had to take care of EBCDIC / ASCII conversion.

So FTP client programmes in general, not just TC's internal ftp function, do not care about EBCDIC / ASCII conversion.

Yet, I would of course not mind if a note were added to the TC help that EBCDIC / ASCII conversion will not be done.

Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Post by *tony01 »

Hi :

Somebody can tell me a way to resolve this problem?

Who knows a good FTP client that supports EBCDIC/ASCII convertions?

Any suggestion is welcome.


Thanks in advance.

Tony.
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Here is an editor that claims to be able to convert EDCDIC to ASCII and back.

So you may download your files in binary mode and then convert or maybe simply edit them with this editor.


sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48096
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

In fact all conversions MUST be done by the server. The client requests ASCII text with the command
MODE A
Then the server must send the file as ASCII text, not as EBCDIC. When MODE I is sent, the server needs to send the file in binary form. This can have unwanted results with text files, especially with VMS machines and some other mainframes. Please make sure that you transfer the files in Text mode. The transfer mode is set in the FTP toolbar which appears when you start a connection.
Author of Total Commander
https://www.ghisler.com
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

ghisler(Author) wrote:In fact all conversions MUST be done by the server. ...
When MODE I is sent, the server needs to send the file in binary form. This can have unwanted results with text files,
Just for my information: What can go worse than already happened and described in the first post?

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48096
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

When I download a text file in binary mode from a VMS server, the resulting file will have no line breaks at all!
Author of Total Commander
https://www.ghisler.com
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

ghisler(Author) wrote:When I download a text file in binary mode from a VMS server, the resulting file will have no line breaks at all!
That could be handled from the editor mentioned above. At least this is stated on the website.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Post by *tony01 »

2Sheepdog:

Thanks Sheepdog,

I will try that editor.
tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Post by *tony01 »

Thanks Sheepdog:

It works, I downloaded a file in binary mode from MVS (OS390) Mainframe then I edited the file in EBCDIC with VEDIT, I made some changes, then I uploaded it to Mainframe in binary mode, and It works, I didn't lose any special/graphic characters, the translation was good.


Thanks .

Tony
Post Reply