Error I/E CPF5029 in file tabview1

bobdylan75 used Ask the Experts™
I don't know why,
in runtime, when I give right keys, my rgple program
gives an error "Error I/E CPF5029 in file tabview1"
in the CHAIN instruction.
Instead if the keys are not in the table so the chain
instruction doesn't break.
In compilation, everything is right.
The table has been created with sql statment CREATE TABLE..
and tabview1 is a DDS LF on this table which gives the right key fields
to the table (4 fields).
KEY           KLIST                          
              kfld                    CDCUSTK
              kfld                    ORDNUMK
              kfld                    ROWK  
              kfld                    STK    
KEY           CHAIN     PR            <======= I/E Error

Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
VP Technology / Senior Consultant
This is a data mapping error.  It means that you have invalid data (probably numeric data) that is being mapped into fields in your view.

Re-create the error, and then display the job log of the job where the error occurred.  Put your curson on the CPF5029 and press F1 to view the extended help text for the CPF5029 error: it explains the problem in detail, including how to figure out which fields are in error.

You'll probably also see CPF5035 or CPD5036 (as explained in the CPF5029 details) that provide more information.

This usually happens when there is bad numeric data that is getting mapped into a numeric field.  For example, there are blanks that are getting mapped into a zoned decimal field, or invalid packed numeric data.

You have a lot of choices.  If it is just a few bad records, perhaps from and old bug, then you may just be able to fix the data one time and be done with it.

Unfortunately, sometimes that's not possible, so you may need to code your program to either handle the error, or provide an alternate view that maps the data into a character field - then your program can test to see if ti contains valid numeric data (TESTN) and convert it or fix it, or ignore it, or whatever is appropriate.

There are also some compile options that allow your program to ignore invalid decimal or zoned data.  These can be dangerous, so use them with care.

- Gary Patterson


Ok you are in right,
it says that 3 fields have incorrect data but this 3 fields have a null value at the moment,
it is not possible to enabled null value as good?
Gary PattersonVP Technology / Senior Consultant

Null value support is a little tricky.  When you create a DB2 field that can contain null values, the system creates a null value flag for that field that must always be checked first to determine if the associated data field.  SQL knows about null indicators, and automatically uses them.

RPG IV provides good null support, but you have to take some specific steps, including properly setting the ALWNULL compile option.

Here's a good article that discusses null handling in RPG:

- Gary Patterson

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial