EXPERT RESPONSE
RPGIV (ILE RPG) treats binary numeric fields in peculiar ways. See this discussion on the subject by Joe Pluta.
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.
|