Is it possible to compress data on the fly as it is FTP'ed from an IBM Mainframe to a Windows FTP Server. We
are trying to avoid the extra step of having to WINZIP the very large file on the FTP sever once the upload is done
from the HOST.

Is there a command in FTP that allows compression on the fly?
Who is Participating?
parkerigConnect With a Mentor Commented:
As mentioned above compatibility no problem, make sure you do a binary ftp - add switch to info I gave above.

Another alternative to FTP is SAMBA

You can then use any Windows zip programme.

Not sure if this can help

const71Author Commented:
thanks for link..unfortunately the ftp client used is that which comes with OS/390 Mainframe
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

There is a couple of ways we handle this.
have a CRON job zip the file before it is FTP'd
You will obviously have to change your FTP script to only send *.zip files.

We have a cron job that runs every couple of minutes that says

if file.txt exists than compress it in our case to file.tar
if file.tar exists then ftp it to server x

the ftp script that runs as a cron, looks like

ftp -n <<SCRIPT                                                                
user anonymous                                                      
put /home/exceed/interface/reports/dlr_backorder.tar dlr_backorder.tar          
put /home/exceed/interface/reports/dlr_CustGroup.tar dlr_CustGroup.tar          
put /home/exceed/interface/reports/dlr_models.tar dlr_models.tar                
put /home/exceed/interface/reports/dlr_price.tar dlr_price.tar                  
put /home/exceed/interface/reports/dlr_qoh.tar dlr_qoh.tar                      
put /home/exceed/interface/reports/dlr_reserved.tar dlr_reserved.tar            
put /home/exceed/interface/reports/dlr_salesorder.tar dlr_salesorder.tar        

Hope this leads you in the right direction

Hi again,

Wasn't too sure if you'd know what I meant by tar.
tar is the unix ( in our case AIX ) "equivalent" of zip.
Winzip opens *.tar files with no problem so end user does not need tar.
In unix if you go man tar you will get the syntax.
man cron gives the syntax for the "scheduled task"

Cheers again

A small note: Parkerig has a good idea. However, a cursory review of the TAR document is that TAR DOES NOT compress files (in fact the documentation available at the OpenGroup specifically recommends running COMPRESS against the archive built by TAR). TAR is merely a packager of multiple files into a single archive.

The idea, however, is reasonable. A script can run the appropriate version of ZIP to compress the files. They can then be transmitted as BINARY files by FTP (the binary is important here, attempting to move binary files between disparate systems will not work reliably without the BINARY specification).

The FTP protocol RFC does not, to my recollection, make any provisions for "on the fly" compression.

I hope that the preceding is helpful.

- Bob (aka RLGSC)
Bob thanks for info.

I have just tested the other inbuilt options - DO NOT RUN without readning man pack or man compress first !

(1) pack - not winzip compatiable
(2) compress - not winzip compatiable.

This lead me on a search for a unix ZIP.

the below URL has a number of zip executables for various OS - hompage so you can get FAQ, source and compile etc. if required.

Cheers to all
if you are running a dial up modem, say as 56k each end, in reality you are compressing the files in midstream about as best as you can, "on the fly", and .zip'ing it will only be improving the intial storage requirements at the receiving end

among my prior efforts, I just set up a batch file to pick up and move the file desired for xmit, and pkzip was suffiicient, running on schedule (of when the file available). Script would copy (or move) file to directory for sending (or for pickup). The xmit scheduler itself ran dependent on whether the directory was empty or had content
const71Author Commented:
I think I am leaning towards compressing the file on the host...FTPing the file to a windows server...but the question concerning compatibility remains. Is it possible to decompress a file that was compressed on the IBM host on the windows platform?
actually, gzip compression is understood by winzip.  If you gzip'd the file prior to ftp, then ftp the file using binary mode, winzip will be able to uncompress the file.

Just wondering if you considered secure copy as it is available in most *nix platforms as well as windows and the -C option compresses automatically.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.