Transferring QSYS.LIB files

This topic discusses the FTP operations in the stream transfer mode and the image transfer mode for the QSYS.LIB file system.

Table 1 and Table 2 summarize FTP operations in stream transfer mode and in image transfer type for the QSYS.LIB file system. Keep the following points in mind when using these tables:

Compatible record length and file size

When you send data to a file that already exists, the record and file size of the receiving file must be compatible with the file being sent or a transfer error will occur. Both the record and file size of the receiving file must be greater than or equal to the source file record and file size. To determine if the existing file size is compatible, you need to consider the current number of records, the number of extensions allowed, and the maximum record size allowed. You can view this information by entering the Display File Description (DSPFD) command.

Automatic file creation on the IBM i operating system

When receiving a file, the system automatically creates a physical file, if one does not already exist. However, it is suggested that you create the file in advance on the system.

Data type

When transferring data using TYPE I, the data is not converted. If the file does not exist, it is tagged with CCSID 65535 when it is created.

Note: File pre-creation is advised when using the MGET and MPUT subcommands to transfer files with multiple members. When a file is not created in advance, FTP creates a file with a maximum record length equal to the longest record of the first member processed. If the record length of any other file member is longer, a data truncation error will occur when transferring that member. Pre-creating a file with a record size to accommodate all members will prevent this error.
Table 1. Stream transfer mode for QSYS.LIB file system
Library exists File exists Member exists Replace selected Compatible record length Compatible file size Result
Yes Yes Yes Yes Yes Yes Data written to member.
Yes Yes Yes No     Transfer rejected and message sent.
Yes Yes No   No Yes File transfer completed, records truncated, and message returned.
Yes Yes No Yes No Yes File transfer completed, records truncated, and message returned.
Yes Yes No   Yes Yes Member created and data written to it.
Yes Yes No No   No Transfer rejected and message sent.
Yes No         File created with record length equal to the maximum record length of the incoming file. Member created and data written to member.
No           Transfer rejected and message sent. Use the Create Library (CRTLIB) command to create a library on the remote system.
Table 2. Image transfer type for QSYS.LIB file system
Library exists File exists Member exists Replace selected Result
Yes Yes Yes Yes Data written to member.
Yes Yes Yes No Transfer rejected and message sent.
Yes Yes No   Member created and data
Yes No      
No