AS400 批量FTP

在SNA网络连接中,AS/400的两块以太网卡能否实现互为备份
解答 AS/400 FTP 提供批处理功能(BATCH FTP),用户无须在FTP交互式环境单独输入FTP子命令。

整个过程包含三部分:

1、CL 程序 - Samplib/SampFile BATCHFTP
2、FTP的子命令文件 - Samplib/SampFile CMDFTP
3、FTP命令执行结果输出 - Samplib/SampFile OUTFTP


例:
CL 程序:


************************************************************
SAMPLIB/SAMPFILE BATCHFTP:
----------------------
PGM
OVRDBF FILE(INPUT) TOFILE(SAMPLIB/SAMPFILE) MBR(BATCHFTP)
OVRDBF FILE(OUTPUT) TOFILE(SAMPLIB/SAMPFILE) MBR(OUTFTP)
FTP RMTSYS(SYSxxx)
ENDPGM
************************************************************


FTP 子命令:

************************************************************
SAMPLIB/SAMPFILE CMDFTP:
---------------------
USERID PASSWORD
CD SAMPLIB
SYSCMD CHGCURLIB SAMPLIB2
GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
QUIT
************************************************************

FTP 命令输出:


************************************************************
FTP Output Redirected to a File
FTP Input from Overridden File
Connecting to host name SYSxxx
at address x.xxx.xx.xxx using port 21.
220-QTCP at SYSxxx
220 Connection will close if idle more than 5 minutes.
215 OS/400 is the remote operating system.
The TCP/IP version is "V4R1M0"
Enter login ID (USERID):
> USERID PASSWORD
331 Enter password.
230 USERID logged on.
250 Now using naming format "0".
257 "QGPL" is current library.
Enter an FTP subcommand.
> CD SAMPLIB
Enter an FTP subcommand.
250 Current library changed to SAMPLIB.
> SYSCMD CHGCURLIB SAMPLIB2
Enter an FTP subcommand.
> GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
200 PORT subcommand request successful.
150 Retrieving member BATCHFTP in file QCLSRC in library SAMPLIB.
250 File transfer completed successfully.
147 bytes transferred in 0.487 seconds. Transfer rate 0.302 KB/sec.
Enter an FTP subcommand.
> QUIT
221 QUIT subcommand received.
************************************************************

原文地址:https://www.cnblogs.com/wildfish/p/1031829.html