Using Server Subcommands

The subcommands that are sent to the server can be created in two ways:
vBy a client subcommand
vExplicitly typed in by the user (with the QUOTE subcommand)
In the first case, the user enters a client subcommand (other than QUOTE) that is
read and converted into one or more appropriate server subcommands by the client
program. In the second case, the user enters an explicit server subcommand
prefaced by the QUOTE subcommand.
QUOTE server_subcommand_and_parameters
Whatever follows QUOTE is sent verbatim to the server; no conversion or
interpretation is done by the client program.
FTP as Batch Job
In addition to running the FTP client interactively,you can run the FTP client in an
unattended mode. Two examples of this method are included in this section: a
simple example and a complex example.

Batch FTP: A Simple Example

The following is a simple example of a batch file transfer that involves the
successful transfer of one file from a remote system.
The components are as follows:
vA CL program
vAn input file of FTP commands
vAn output file of FTP messages
The CL Program
************************************************************
ITSOLIB2/QCLSRC BATCHFTP:
----------------------
PGM
OVRDBF FILE(INPUT) TOFILE(ITSOLIB2/QCLSRC) MBR(FTPCMDS)
OVRDBF FILE(OUTPUT) TOFILE(ITSOLIB2/QCLSRC) MBR(OUT)
FTP RMTSYS(SYSxxx)
ENDPGM
************************************************************
The BATCHFTPprogram overrides the INPUT parameter to the source physical file
ITSOLIB1/QCLSRC MBR(FTPCMDS). The output is sent to MBR(OUT).
The Input Commands File
************************************************************
RLDICK/QCLSRC FTPCMDS:
---------------------
ITSO ITSO
CD ITSOLIB1
SYSCMD CHGCURLIB ITSOLIB2
GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
QUIT
************************************************************
The FTP subcommands required are shown in the FTPCMDS file.
Chapter7. File Transfer Protocol (FTP) Client 269