Example: Creating the FTP input file (FTCPDMS)
The FTP input file must contain all the FTP client subcommands necessary to connect and log on to the FTP server, set up and complete the file transfers, close the connection, and end the client session. This example shows the subcommands used for transferring files to two different remote systems.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
The following explanation can help you to understand the FTP client subcommands shown in Figure 1. The line numbers on the display correspond to the numbers that follow.
- 0001
- User ID and password for dummy connection within client system SYSNAM03.
- 0002
- Close dummy connection on system SYSNAM03.
- 0003
- Open control connection to RISC System/6000 SYSNAMRS.
- 0004
- USER subcommand with user ID and password for SYSNAMRS.
Note: When running FTP in batch mode, the USER subcommand must
follow an OPEN subcommand. Both the logon user ID and password parameters
for the USER subcommand should be provided. This is different when operating
FTP interactively online. When FTP is run interactively online, and then the
client will automatically initiate a USER subcommand and prompt you for a
logon ID. There is no automatic USER subcommand when running FTP in batch
mode.
- 0005
- Transfer ASCII data (will be converted on the system to/from EBCDIC).
- 0006
- CL command to be run on the client system to delete the file. (You could instead use the REPLACE parameter with the next statement, the get.)
- 0007
- Retrieve file from RISC System/6000 system.
- 0008
- Close control connection to RISC System/6000 SYSNAMRS.
- 0009
- Open connection to VAX MVAX.
- 0010
- USER subcommand with user ID and password for MVAX.
- 0011
- Retrieve file from VAX replacing existing IBM® i file.
- 0012
- Close control connection to VAX MVAX.
- 0013
- Open control connection to remote system SYSNAM02.
- 0014
- USER subcommand with user ID and password for SYSNAM02.
- 0015
- Transfer EBCDIC data (as it is from a IBM i platform to a IBM i platform).
- 0016
- Send IBM i files to system SYSNAM02 with TCP/IP.
- 0017
- Send this file from system SYSNAM03 to remote system SYSNAM14 through TCP/IP network.
- 0018
- Close control connection to system SYSNAM02.
- 0019
- End FTP application.