CPF5029: Data mapping error on member
CPF5029 means the database found a field in a record that it couldn't convert to or from its defined type, such as letters in a numeric field or an invalid date. The I/O operation fails, and the message CPF5035 before it names the field.
Other names for this code
Also written as CPF5029 data mapping error, MSGID CPF5029, data mapping error on member, CPF5029 CPF5035, decimal data error file.
What it means
CPF5029 has the text "Data mapping error on member" followed by the member name. It is a database I/O message from the CPF5001 to CPF50FF range, which IBM describes as notify messages with a default reply of cancel.
Data mapping is the step where the database copies a record between the file and the program's buffer. It also converts fields where needed, for example between date formats or between zoned and packed decimal. If a field holds data that isn't valid for its type, the conversion can't be done and the operation fails.
The second-level text gives the file, library and member, and the record number and format of the record in error. It refers you to the message listed before it, usually CPF5035, which names the field and gives a reason code for the problem.
A record number of zero in the message means the bad data didn't come from a stored record. It can come from a write or update through a logical file, a group-by operation, a default value or a null value.
Common causes
- A program that uses an internally described file, or a file transfer, wrote characters or blanks into a numeric field. Later, an operation that has to convert that field fails on the bad bytes.
- A date, time or timestamp field holds a value that isn't valid in its format, or a date that can't be shown in a two-digit-year format such as *MDY. That format only covers 1940 to 2039.
- A program wrote a record without setting a date field, so it held blanks, which aren't a valid date.
- A logical file maps fields to a different type or format from the physical file, and some stored values don't convert.
- A null value reaches a program or operation that can't accept nulls.
How to find the problem
- Run DSPJOBLOG and press F1 on CPF5029. Note the record number, the record format and the member.
- Look at the message before it, usually CPF5035. It names the field in error and gives a reason code that says what kind of problem the data has.
- Look at the record in hex. With the record number from the message, display it with DSPPFM (F10 for hex) or select it with SQL using
WHERE RRN(ORDHDR) = 4411. - Find the program or interface that wrote the record. If the file is journaled, the journal entries for that record number name the job and program.
How to fix it
- Correct the bad field in the record with a tool that can write raw values, such as UPDDTA or an SQL UPDATE by record number, and run the program again.
- Fix the program that wrote the bad data, for example by declaring the file externally so field types are checked, or by setting every numeric and date field before a write.
- For date problems, use a four-digit year format such as *ISO or *USA in files that can hold dates outside 1940 to 2039.
- Give date fields a valid default in the DDS or table definition so a program that doesn't set them can't write blanks.
- Clean the data in a file transfer before it lands in the production file, or load it into a work file and check it first.
What it looks like
Data mapping error on member ORDHDR.
IBM documentation
IBM Display Message Descriptions (DSPMSGD). Use the documentation for your installed release.
This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.
Read the installed message description:
DSPMSGD MSGID(CPF5029) MSGF(QSYS/QCPFMSG)
Also inspect the full job log and second-level message text, including substitution values.
Related codes
Questions
Why does reading a record fail with CPF5029 when the program didn't write it?
Another program or a transfer stored bad data earlier. The read is just where it is noticed, when the database tries to convert the field for your program.
Where do I find which field is wrong?
Read the message just before CPF5029 in the job log, usually CPF5035. It names the field and gives a reason code.
What does record number zero in the message mean?
The data didn't come from a stored record. It came from a write or update through a logical file, a group-by, a default value or a null value.