Skip to content

FTP an iSeries Physical File in CSV format

Looking for an example project to get you started?
  • User avatar
  • Support_Julie Offline
  • Support Specialist
  • Posts: 91
  • Joined: Thu Mar 05, 2009 3:49 pm
  • Location: Ashland, NE USA
  • Contact:

FTP an iSeries Physical File in CSV format

Post by Support_Julie »

FTP an iSeries Physical File in CSV format

This project will convert a Physical file into a comma delimited CSV file, then FTP to your trading partner.
The physical file should be converted to something like a CSV file so that the receiving server will be able to read it.

In this example, we use of the iSeries CPYTOIMPF command.

Code: Select all

<project name="Physical File CSV FTP" mainModule="Main" version="1.0" logLevel="debug">
	<description>convert a Physical file into a comma delimited CSV file, then FTP.</description>

	<module name="Main">

		<createWorkspace />


		<exec400 resourceId="DEV 54">
			<command>
				<![CDATA[CPYTOIMPF FROMFILE(SURVEYOR/DEMO) TOSTMF('${system.job.workspace}/FILE.CSV') STMFCODPAG(*PCASCII) RCDDLM(*CRLF)]]>
			</command>
		</exec400>


		<ftp resourceId="Dev 54">
			<put sourceFile="FILE.CSV" destinationFile="/demo/MYFILE.csv" type="auto" />
		</ftp>


		<deleteWorkspace />

	</module>

</project>

Julie Rosenbaum
Sr Support Analyst
e. [email protected]
p. 1.800.949.4696
w. HelpSystems.com