Previous Topic: LINES Statement—Specify the Number of Lines per List PageNext Topic: LOCALNAME Statement—Specify Local Filenames (FTP Jobs)


LOCALFILENAME Statement—Specify Local Filenames (FTP Job)

The LOCALFILENAME statement specifies the name of one or more files on the agent computer involved in an FTP transfer.

Supported Job Types

This statement is required for the following FTP job type.

Syntax

This statement has the following format:

LOCALFILENAME file_name[; file_name...]
file_name

Specifies the destination of the file (if downloading) or the source location of the file (if uploading).

Limits: The total of all files specified cannot exceed 256 characters; case-sensitive

UNIX/Windows:

i5/OS:

Notes:

Example: Download a Single File

This example downloads an ASCII file named textfile from the remote UNIX server to the /export/home/ftpfiles/ftpdata/Folder directory on the agent computer:

AGENT UNIXAGENT
USER test
SERVERADDR hprsupp
SERVERPORT 5222
TRANSFERDIRECTION D
TRANSFERCODETYPE A
REMOTEFILENAME /u1/qatest/ftpdata/textfile
LOCALFILENAME /export/home/ftpfiles/ftpdata/Folder/textfile

Example: Download Multiple Files

This example downloads multiple ASCII files from a remote UNIX server. Note that the number of files listed in the REMOTEFILENAME and LOCALFILENAME statements must match. Single quotes enclose both lists to accommodate the line continuation character (+).

AGENT UNIXAGENT
USER test
SERVERADDR hprsupp
SERVERPORT 5222
TRANSFERDIRECTION D
TRANSFERCODETYPE A
REMOTEFILENAME '/u1/test/scripts/echo;+
  /u1/test/scripts/echo1;+
  /u1/test/scripts/echo2'
LOCALFILENAME '/export/home/test/ftpdata/echo;+
  /export/home/test/ftpdata/echo_1;+
  /export/home/test/ftpdata/echo_2'

Example: Upload Files to a Directory Using a Wildcard

If a wildcard is used in a local file name for upload, the remote file name (the target) must refer to a directory. In this example, the remote file name is specified as the directory /tmp.

AGENT UNIXAGENT
USER test
SERVERADDR hprsupp
SERVERPORT 5222
TRANSFERDIRECTION U
TRANSFERCODETYPE A
REMOTEFILENAME /tmp
LOCALFILENAME /export/home/qatest/ftpdata/text*

Example: Download a QSYS.LIB EBCDIC-Encoded File

This example downloads an EBCDIC-encoded file in the QSYS file system from an i5/OS server to another i5/OS system. The file names are specified in the path format.

AGENT I5AGENT
USER test
SERVERADDR i5agent
SERVERPORT 5222
TRANSFERDIRECTION DOWNLOAD
TRANSFERCODETYPE E
LOCALFILENAME /QSYS.LIB/FTPLIB.LIB/DOWNLOAD.FILE/DATA.MBR
REMOTEFILENAME /QSYS.LIB/DATALIB.LIB/DATAFILE.FILE/DATA.MBR