IBM Support

CPYFRMIMPF Fails to Convert All Records CPIA083

Technote (troubleshooting)


Problem(Abstract)

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.

Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 7.1
Operating System IBM i 6.1

Document information

More support for: IBM i
DB2 for IBM i

Software version: Version Independent

Operating system(s): IBM i

Software edition: Standard

Reference #: N1019994

Modified date: 15 November 2016


Translate this page: