IBM Support

CPYFRMIMPF Fails to Convert All Records CPIA083

Troubleshooting


Problem

This document describes one scenario why CPYFRMIMPF fails to convert a .csv file to a database file.

Symptom

msgCPIA083 on CPYFRMIMPF and not all records are copied

Diagnosing The Problem

CPYFRMIMPF fails to copy a .csv file to a database file.
The TOFILE physical file only gets 1 record added and the data is all invalid.

The joblog shows:

CPYFRMIMPF FROMSTMF('\pathname\myfile.csv') TOFILE(mylib/impfile) MBROPT(*REPLACE) RCDDLM(*CRLF) RPLNULLVAL(*FLDDFT)

CPC3101 Member IMPFILE file IMPFILE in MYLIB cleared. 
CPIA083 Stream file copied to object with truncated records.

A .csv file that is created by an ASCII system such as a PC usually contains ASCII data (CCSID 819).

However if it is marked as EBCDIC data (CCSID 37), the System i looks for a carriage return and line feed (CRLF) has hex 0D25 (CCSID 37) and not hex /0D0A (CCSID 819).

The hex data in the .csv file shows hex 0D0A for CRLF but display attributes shows CCSID 37.

Resolving The Problem

Determine what part of the process of FTPing the data to the IBM i is setting the CCSID to 37 when it really contains data in a different CCSID

Alternatively, run CHGATR to change the CCSID of .csv file from 37 to 819.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"DB2 for IBM i","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"Standard","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
18 December 2019

UID

nas8N1019994