Page 2 of 2

Re: UNIX-Mainframe FTP

PostPosted: Sat Nov 26, 2011 1:03 pm
by nxkjh
FTP from Unix to mainframe is no problem provided the mainframe supports FTP and the associated TCP/IP stack. Some mainframes use EBCDIC instead of ASCII for text file so you may have to convert your data.

I assume that you want to run the script at the Unix end. For this I usually recommend using Expect to drive the FTP session. I use this to maintain my own web-site. Recently, I have come across LFTP which may be a better alternative as it includes a scripting language.

I would avoid running FTP directly from a shell script. This approach will usually work fine until the FTP session fails. Then it becomes difficult to work out was has worked and what has failed.

I have put some links below. Before downloading any of these packages you should check your Unix/Linux distribution. You may find that you already have the software.

Re: UNIX-Mainframe FTP

PostPosted: Sat Nov 26, 2011 3:39 pm
by BillyBoyo
nxkjh wrote:FTP from Unix to mainframe is no problem provided the mainframe supports FTP and the associated TCP/IP stack. Some mainframes use EBCDIC instead of ASCII for text file so you may have to convert your data.[...]


What can you mean by all this? Why do you refer to "Unix", an Operating System, and "mainframe" a piece of hardware? The hardware does not support FTP or TCP/IP (it is hardware, those things are software) except in the vague sense that you can run software on hardware. On a mainframe, you can even run a Unix. What then of your opening sentence?

What is this "some" use EBCDIC? You are in an IBM mainframe forum. How many times have you used an IBM mainframe that does not use EBCDIC? And EBCDIC is not just for "text", nor is ASCII. You can FTP non-text files. I'm not bother to look at the original question because it is old, and the chances are that the Topic Starter has long since moved on to something else.

Re: UNIX-Mainframe FTP

PostPosted: Sat Nov 26, 2011 7:27 pm
by Robert Sample
1. For the last dozen and more years, EVERY mainframe operating system supports the TCP/IP stack. Implying one doesn't says that you know almost nothing about mainframes -- so why are you responding to a topic about mainframes?

2. IBM mainframes use EBCDIC, period -- not "some" of them. EBCDIC to ASCII conversion is part of FTP and automatic for text transfers. For binary transfers, there are many other issues which would have to be discussed as they arise (such as line terminators, variable length records, and non-display numbers if the mainframe originated the file).

3. z/OS supports REXEC, which allows a mainframe to initiate a Unix shell script on a Unix server. The facilities you mention would have to be installed, while REXEC is already on the mainframe as it is part of z/OS TCP/IP.

4. Production workloads generally mandate automation of everything possible -- using shell scripts and cron to do so is one way on a Unix server to do that. There are other ways, of course. But most sites do not want to dedicate a person to running an FTP of a multi-gigabyte file every day of the week.

Re: UNIX-Mainframe FTP

PostPosted: Sat Nov 26, 2011 7:56 pm
by steve-myers
Just to amplify Mr. Sample's post: IBM mainframes running MVS, z/OS, VM/370, z/VM, or VSE use EBCDIC. IBM mainframes running Linux use ASCII.

Re: UNIX-Mainframe FTP

PostPosted: Sun Nov 27, 2011 11:14 am
by steve-myers
nxkjh wrote:FTP from Unix to mainframe is no problem provided the mainframe supports FTP and the associated TCP/IP stack. Some mainframes use EBCDIC instead of ASCII for text file so you may have to convert your data. ...
The FTP standard is all text data is sent in ASCII; conversion of ASCII to EBCDIC or EBCDIC to ASCII is always done at the EBCDIC machine.