|
On Sat, 15 Jan 2000, Mike Silvers wrote:
> We are trying to run the FTP command in a batch program. When prompting
> the FTP command, there are no parms for the username, password, etc for
> the remote computer. Any ideas?
We do this everyday. Here is a short CL program that takes as parameters
the host you want to ftp with and the script containing the ftp commands:
PGM PARM(&HOSTNAME &SCRIPT) /* Test run of FTP +
batch mode */
DCL VAR(&HOSTNAME) TYPE(*CHAR) LEN(50)
DCL VAR(&SCRIPT) TYPE(*CHAR) LEN(10)
OVRDBF FILE(INPUT) TOFILE(JAMES/QCLSRC) MBR(&SCRIPT)
OVRDBF FILE(OUTPUT) TOFILE(JAMES/QCLSRC) MBR(FTPMSGS)
STRTCPFTP RMTSYS(&HOSTNAME)
DLTOVR FILE(*ALL)
ENDPGM
Of course you will want to change things like the library/source file that
things are located in (I use my own testing library JAMES and keep stuff
in QCLSRC). Probably make these variables also.
A short script looks like this:
username password
cd /the/directory/of/your/choice/
binary
put <library>/<file>.<member> <remotefilename>
close
quit
Feel free to contact me with any questions.
James Rich
james@dansfoods.com
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.