FTP Client Application Programming Interface (API)

This topic describes the FTP Client Application Programming Interface (API) to the z/OS® FTP client. This topic explains how to initialize the interface, how to use the interface to submit a subcommand to the client, how to retrieve results of a request, and how to terminate the interface.

The following terms apply:
  • Subcommand refers to z/OS FTP client subcommands.
  • Request refers to a request sent to the interface (see Sending requests to the FTP client API).
    A subcommand might result from a request, because a request can do the following tasks:
    • Invoke a specific subcommand (on an SCMD request)
    • Result in an implicit subcommand (OPEN resulting from INIT)
    • Automatically generate a subcommand (QUIT sent by TERM)
    • Result in no subcommand (INIT with no host name or IP address included in start parameters; TERM issued after the user has explicitly issued SCMD QUIT; GETL; or POLL)
Guideline: Subcommands are processed by the z/OS FTP client. Some subcommands result in one or more FTP commands being sent to the FTP server. Examples of subcommands and commands are:
  • LOCSTAT is a subcommand. No command is sent to the server for this subcommand.
  • SYSTEM is a subcommand; a SYSTEM subcommand causes the client to send a SYST command to the server.
  • GET is a subcommand. A data connection establishment command (PORT, PASV, or EPSV) might be sent to the server; then a RETR command is sent to the server.
Tip: FTP subcommands in z/OS Communications Server: IP User's Guide and Commands describes the subcommands that are supported by the z/OS FTP client.

The interface to the z/OS FTP client enables a user program to send subcommands for the client to process. The user program can multitask to different instances of the interface by requesting no-wait mode when processing a subcommand. The interface also enables the user program to retrieve output that includes the messages from the client, replies from the FTP server, and other data generated as the result of the request.

The interface requires the use of an FTP Client Application Interface (FCAI) control block that is created by the user program (see FTP Client Application Interface (FCAI) control block). The FCAI is a parameter on all calls to the interface and it is used to pass information between the interface and the user program.