FTP_COMMANDLIST

This activity executes a list of LANSA Integrator FTP service commands.  Note that it is the LANSA Integrator service commands that are specified (not the native FTP client commands).

If you wish to execute native FTP client commands directly on an IBM i server, then you should refer to the FTP_SCRIPT activity.

This Activity connects to the FTP host specified in the FTP Configuration and then executes LANSA Integrator FTP service commands from a command list file. The command list file may be specified on the FTP Configuration or overridden by the COMMANDLISTFILE parameter. The command list file is a text file.

An email Event notification named FTPCMDLSTFAILED is available in this Activity. If this event is active and a failure occurs in this Activity, then an email will be sent. Refer to Event Maintenance for setting up Event notifications.

INPUT Parameters:

FTPCONFIG: Required

This parameter should contain the name of an FTP Configuration with the type of Command List.

If this parameter is not provided or is not found, this Activity will return an error and processing will be abandoned.

COMMANDLISTFILE: Optional

This parameter specifies the path and file name of the FTP service command list file.  If this parameter is not provided, then the command list file from the FTP Configuration will be used. Refer to the FTP Configuration for a description and examples of command formats.

OUTPUT Parameters:

There are no output parameters.

Processing

This Activity uses either the LANSA Integrator FTPService or SFTPService (depending on FTP configuration choices).

It uses the Connection information from the FTP Configuration to connect to the remote host.

The command list file is read, one line at a time. The line terminator may be a carriage return, line feed, new line, carriage return line feed or line feed carriage return. Lines with a first character of # are considered to be comments and are ignored. All other lines should contain a single service command which can be used by the LANSA Integrator FTPService or SFTPService. These commands are executed using the LANSA Integrator service and must conform to that format.

Example FTP Service Command List

The following script might be used with a correctly configured FTP configuration to create a directory on the remote FTP server and copy a file from the local system to the new directory.  The FTP configuration used must specify the remote host name and the remote user and password used to connect to the remote host.

# *****************************************

# This is a sample FTP Service Command list

# *****************************************

CHGDIR PATH(MYDIR1)

CREATE DIR(MYDIR2)

PUT FROM(order.xml) TO(/MYDIR1//MYDIR2/order.xml)

QUIT

# *****************************************