Q

Troubleshooting mainframe to Linux FTP

Programming expert Mark Zelden offers some coding help to a user trying to FTP files from the mainframe to a Linux OS.

We are trying to FTP files from Mainframe to Linux OS. The files look good when FTP'd from Mainframe to Unix. But Mainframe to Linux puts an extra byte at the end of line. Any help is appreciated. Thanks!!!
I will try to help, but you didn't say which direction the FTP was going (PUT vs. GET). That is important to know because it could be an FTP server issue or an FTP client issue and I don't know which platform (z/OS or Linux) is the client or server. You also didn't say if this was a binary transfer or ASCII. I am assuming this is an ASCII transfer.

You (or one of your local Unix and Linux admins) should compare all of the FTP server and client default settings between Unix and Linux. However, that still may not provide the answer.

What is in the extra byte? 0x0D? You may be able to use a program on Linux to remove te extra byte. One I have heard of is called "dos2unix". The Unix tr (translate) command can also be used to delete the extra byte. Assuming the extra byte is a carriage return (CR), the command would look like this:

tr -d '\r' ‹input.file ›output.file

Substitute '\r' with 'n' if the extra byte is newline.

Hope this helps.

This was first published in November 2006

Dig deeper on Mainframe Linux, IBM System z

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

SearchEnterpriseLinux

SearchServerVirtualization

SearchCloudComputing

Close