GIVEN: I am a novice on the AS400 platform, at best
PROBLEM: We need to transfer variable width, pipe-delimited ASCII files from a Windows 2003 server to an FTP server running on V6R1. The files arrive and are properly translated to EBCDIC, but they are huge. A 3.5Mb file becomes a 200+ Mb member. A 9Gb file fails because we bump up against some manner of quota.
INTERESTING FACT: When done in binary mode (no translation), the file appears on the server side as FILENAME.FILE with one member named FILENAME.MBR. The transfer size is correct, but the file is not readable by native tools because of the ASCII encoding.
INTERESTING FACT: This has been tried on three V6R1 machines with the same results. So I’m fairly certain this is normal behavior that I just do not understand well.
My gut feeling here is that the server is extending the file as it adds new rows to it — but I really don’t have a better guess that that at this point. Has anyone seen this behavior before, and do you know what it takes to avoid it?
Thanks in advance to anyone taking the time to contribute. I do appreciate it.
The IBM i FTP server can either deal with objects in the “classic” QSYS.LIB file system (where you have objects such as files residing in a single layer of libraries) or stream files on the Integrated File System (a hierarchical file system similar to what’s used in Windows and Unix).
It sounds like you’re sending the file into a Physical File (PF) in the QSYS.LIB file system. A PF has fixed-length records, so you’re probably seeing some slack space at the end of most records. You can see how many records are in the PF and the record length using the
DSPFDCL command.If you want to send the file to a PF, the FTP server defaults to name format 0, which is the QSYS.LIB file system. In this mode you’d send to a PF such as this:
If you want to send the file to a stream file, you have to first send a command to the FTP server:
This switches the FTP server into IFS naming mode. As a result, when you send the file you’ll need to specify what directory you want to send it to. For example:
If you’re sending up variable-length records, that IFS stream file will have no slack as you’d see in a Physical File.
If the pipe-delimited file contains a single layout, you can use the
CPYFRMIMPFCL command to map it into a PF with an actual record format, which is probably the more “native” way to do it. If it’s a more complex file format, however, you might have to write an ILE RPG program to convert the stream file into whatever form it needs to be in. Here are some great tutorials on accessing stream files from ILE RPG.Also note that you can see some interesting help info from the IBM i FTP server using the
QUOTE HELPcommand while connected from a command-line FTP client.