Downloading file from mainframe to UNIX

Hi All ,
I need a help regarding file ftp ing from mainframe to unix.Our source file is mainframe file.I need to download the mainframe file to local unix server through unix script.If anyone can help me how we can do it through unix script ,it will be really helpful.Thanks.

at the time I used to do such things you would have to use true basic ftp understood commands... then mainframes are proprietary OS, to know what exactly you can do will depend of the mainframe OS that you have not mentionned... For except puts and gets, how you connect to the mainframe using ftp we cant guess what you need...

Hi ,
The mainframe OS we are using is z os.We have mainframe host server ip ,user name ,pw ,mainframe file name and its corresponding location information,then could you suggest me through which unix command or unix script ,we can download the large volume mainframe file to local unix.Your help in this regard will be highly appreciated.Thanks.

Why do you think that you need a script? You would normally only use a script to run the ftp repeatedly. Also, before you try to write script, you should check that it works interactively (from the command line). If you can't get it to work interactively then you have no chance trying to script it.

---------- Post updated at 07:45 PM ---------- Previous update was at 07:44 PM ----------

Do you know whether the mainframe has a ftp server?
Do you know whether the Unix system has a ftp client?

I will add that you havent mentionned the type of file either, mainframes use specific file formats, do you know if they have been adapted/converted to be usable under UNIX or will you have to do that after?

Hi hicksd8,
The unix server we are using it is working interactively from the commandline.The unix scripts are running fine from our unix system.And the mainframe has a ftp server and unix system also having ftp client.

@vbe ,

The mainframe ebcdic file has been converted to readble format in the mainframe system only through sort technique.We just need the download the readble format file from the mainframe location to the unix local box through unix script.If you kindly help me in this regard ,it will be really helpful.Thanks!

If you did a bit of search in the forum here you would have found e.g.

What more do you want?

Hi vbe ,
The script attached in the below url is below :

#!/bin/ksh
function ftp_files
{
ftp -n ${D2_SRVR} <<EOF
 quote user ${D2_UID}
 quote pass ${D2_PWD}
 cd ${D2_DIR}/${D2_NAME}
 lcd ${D1_DIR}/${D1_NAME}/dml/
 put file1
EOF
}

I am not totally clear on this.it seems putting the file in the destination server.Kindly explain this.

We need to download the file from mainframe to unix server.I got another script from the forum.Please find below.

#! /bin/bash
REMOTE_HOST=10.237.5.100        # Hostname of the remote Mainframe system
export USER=U213394     # Username on mainframe
export PASSWD=MUMBAI17  # Passsword on mainframe
REMOTE_FILE=FIXED.FLAT12.D15156.T66169 # Filename on remote mainframe system
LOCAL_FILE=/home/T66169_T.TXT      # Local filename to be created
/usr/lbin/secftpbatch $REMOTE_HOST ascii get $REMOTE_FILE $LOCAL_FILE
exit 0

when we are executing the above script like below :
./ftpscrpt ,we are getting below error :

./ftpscrpt
./ftpscrpt: line 7: /usr/lbin/secftpbatch: No such file or directory

It will be really helpful if you kindly help me in the above mentioned scenario.Thanks !