To use FTPTFR to send a physical file from the IFS to a server in TXT format, set the following FTPTFR parameters:

  • LCLFIL - The name of the file in the IFS.
  • RMTFIL - The name to give the file on the server.
  • LCLDIR - The path to the file in the IFS.
  • RMTDIR - The folder to save the file in on the server.
  • FUNCTION - Type PUT to put the file on the server.
  • FORMAT - Type ASCII to perform an ASCII translation.
  • CMD1 - Call the iSeries command CPYTOIMPF before sending the file.

    The Copy To Import File (CPYTOIMPF) command copies an externally-described file to an import file - that is, a file created to copy data between heterogenous databases. The import file (TOSTMF or TOFILE parameter) is called the to-file for this command.        

For example:
 
FTPTFR LCLFIL(ECEBOP.TXT) RMTFIL(ECEBOP.TXT) LCLDIR(/) RMTDIR('\TEST') FUNCTION(PUT) USR(TEST) PWD(TEST) FORMAT(ASCII)   LOGOPT(*DSP) CMD1('SYS CPYTOIMPF FROMFILE(BRAD/ECEBOP) TOSTMF(/ECEBOP.TXT) MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF)  DTAFMT(*FIXED)')
 

Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016