
Return to the FTP Tips
Automated Batch Data Transfers from AS/400 to PC
In a CL program, CPYTOIMPF to create a CSV file on the AS/400, and FTP the resulting file to the PC. In my experience, the only way to get a truly useful CSV from CPYTOIMPF is to create a stream file on the IFS, and use the *CRLF record delimiter option.
For example:
CPYTOIMPF FROMFILE(MYLIB/MYFILE)
TOSTMF('/home/paul/myfile.csv')
MBROPT(*REPLACE)
RCDDLM(*CRLF)
Then, in the FTP session, use the command NAMEFMT 1 before doing a PUT
to the FTP server on the PC.[report a broken link by clicking here]






