You can see from the article that RPGIV will 'think of' incoming integer fields as binary, and then will redefine...
them in the program structures as PACKED (!). This means that when you CHAIN a record, the incoming data has to be converted from Integer (which RPGIV thinks is Binary) to Packed - and RPG has not allowed enough digits to hold the data. So, it generates the error message.
The best way to get around this is to ALWAYS use an externally-described data structure to hold an incoming record:
D DataIn E DS ExtName( MyFile )
...you don't need any more than that. The record from MYFILE will automatically dump its data into the structure, and RPGIV will obey the record format definition in the EXTNAME keyword, so it will NOT start redefining fields as packed.
Dig Deeper on RPG iSeries programming
Related Q&A from John Blenkinsop
When an error occurs on an IBM command, the diagnostic messages are sent first, then an escape message, which you can monitor. On AS/400 you see the ... Continue Reading
Learn how to 'append data to the file' with the FTP DIR command, and eliminate the hassle of having to end the FTP session and restart to view ... Continue Reading
When AS/400 running STOP gives the error message 'Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C', the... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.