IBM Support

FTP and File Conversions Using Coded Character Set Identifiers (CCSID)

Troubleshooting


Problem

When using FTP to transfer a file from a non-IBM iSeries family of servers client to an iSeries family server, files might have characters appear in the wrong format.

Resolving The Problem

Scenario

A Microsoft Windows PC user is trying to FTP a file (PUT) to the IBM iSeries family of servers system. The file contains numerous exclamation points (!); however, after it is transferred to the iSeries family system, the exclamation points convert to pipe characters (|).

Note: This happens only when attempting to transfer the file into the library file system. If the file is transferred to an Integrated File System directory, the characters display correctly.

Problem Description

Because the iSeries family FTP server must convert files from ASCII to EBCDIC (when using the library file system), a Coded Character Set Identifier (CCSID) gets used to translate data into a readable format. In the scenario listed above, when the Windows file is transferred to the iSeries family system, the file gets created with a CCSID of 500. The CCSID of 500 translates the exclamation point into a pipe character. If the database file is not pre-created, FTP calls an API to determine the best fit CCSID for the data. Because the incoming data is in CCSID 819 (according to the FTP attributes using the CHGFTPA command), the API tells FTP that the best fit single-byte EBCDIC CCSID for CCSID 819 is CCSID 500. Therefore, the FTP application creates the file in CCSID 500.

Resolution

One of the following options can be used to get around the invalid character caused by the FTP transfer:

Option 1:Pre-create the file using a valid CCSID (look at the QCCSID system value and try that, or try the CCSID defined in the User Profile).
Option 2:Change the CRTCCSID value on the CHGFTPA command to *USER or *SYSVAL to force all database files (Qsys.Lib) created by the FTP server to use the user's CCSID setting (*USER) or the system QCCSID value (*SYSTEM).
Option 3:To change only the CRTCCSID setting for a single FTP session, type one of the following FTP subcommands before the PUT:

QUOTE SITE CRTCCSID *USER

QUOTE SITE CRTCCSID *SYSVAL
Using Option 2 or Option 3 forces FTP to choose the CCSID based on the user or system values rather than using the calculated value (*CALC, which is the default value for CRTCCSID and is the way FTP has worked since earlier releases).

If the file is going to the Integrated File System, use the following command:

QUOTE TYPE C N

where N is a valid CCSID (for example, 819, 37, and so on).

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Communications-TCP","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

373105478

Document Information

Modified date:
18 December 2019

UID

nas8N1015632