Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP batch file

Status
Not open for further replies.

dennysthemenace

Technical User
Jun 20, 2004
28
US
Hi

Can any one please let me know how to pass a file from DSTX to a FTP batch script? I used batch adapter to call a simple batch file to write and delete stuff, but I am not sure how to use it with FTP since it calls a script and gets the data from there. Below is the batch file and the script. I call the ftp batch file, but how can I can I pass the file name and file itself through the batch adapter to the batch file during run time? I appreciate any help. Thanks.

ftp -s:ftp.txt--- batch file

ftp>----script
open mainframe.net
user
pwd
prompt off
bin
quote site fixrecfm 500
quote site cyl
quote site pri=25
quote site sec=25
cd Apr19
mput test*.txt
 
Easiest way is to write the ftp commands to a file from Mercator and then run the batch adapter with the batch file containing the name of the command file.

I use this in a bat file. %1 is the name of the file to be ftp'd just to ensure it exists.

ECHO OFF
IF EXIST "%1" ftp -s:MERCCFR031Dftprun.txt > MERCCFR031Dftplog.txt
 
This way I have to write the files on the disk and then use the batch file and scripts to ftp these files. Can batch and script files not be wriiten in a single batch file, which will receive the files and ftp them directly from memory during runtime?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top