RNQ0103: Numeric result too large for its target
RNQ0103 means an ILE RPG calculation produced a result with more digits than the receiving field can hold. It matches RPG program status code 00103, and the program is waiting for a reply.
Other names for this code
Also written as RNX0103, status 00103, RPG status 103, %STATUS 103, RPG numeric overflow, target too small to hold result.
What it means
RNQ0103 is an ILE RPG runtime message for program status 00103. IBM's ILE RPG Reference describes that status as an intermediate result that is too large for the field it is going into. A packed field defined as 7 digits with 2 decimals can hold at most 99999.99. If a calculation puts 123456.00 into it, the high-order digits don't fit and the runtime raises the error instead of storing a wrong number.
The machine reports its own overflow first, so the job log often shows MCH1210 just before the RPG message. Expressions, such as those in EVAL, always check for this. Older fixed-form operations such as ADD, SUB, MULT and Z-ADD behave differently. By default they drop the high-order digits and carry on, which is controlled by the TRUNCNBR setting. That is why a program can run for years with a silent truncation in one place and fail with RNQ0103 in another.
RNQ0103 is the inquiry form. It appears when nothing in the program handled the error, and the job stops until someone answers. RNX0103 is the escape form of the same condition. It doesn't wait for a reply and is what a MONITOR group or a calling program sees.
Common causes
- A running total that grew beyond the size of its field, for example yearly sales added into a field sized for one month.
- Data larger than the program was designed for, such as a quantity or price with more digits than expected.
- A multiplication that produces more digits than the result field has, often in currency or unit conversions.
- A value moved into an integer field outside its range, for example more than 2147483647 into a 10I 0 field.
- A %DEC or %INT conversion of a value that doesn't fit the length given.
How to find the problem
- Press F1 on the message for the procedure, program and statement number. For a batch job, check QSYSOPR (DSPMSG QSYSOPR) or the job log (DSPJOBLOG).
- Look for MCH1210 just above it in the job log. It confirms a numeric receiver that is too small.
- Find the statement in the compile listing. Note the size of the result field, then look at the values being combined.
- Reply D to get a formatted dump that shows the field values when the program failed, or rerun under STRDBG and stop on that statement.
How to fix it
- Make the receiving field bigger. If it is a database field, change the file and recompile every program that uses it, or you will get level checks.
- For totals, use a work field with plenty of digits and only move the result to the smaller field after checking it fits.
- Check unusual input before the calculation and reject or report records with values out of the expected range.
- Use a MONITOR group with
ON-ERROR 00103where the program can sensibly recover. - Reply C for the job that is waiting now, then correct the program or data and rerun.
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.
Related codes
Questions
Why didn't the same overflow fail in an older program?
Fixed-form arithmetic operations such as ADD and Z-ADD truncate high-order digits by default instead of raising an error. Expressions, such as those in EVAL, always raise status 00103, so the same data can fail in new code and slip through in old code.
Is RNQ0103 the same as MCH1210?
They report the same overflow at different levels. MCH1210 is the machine exception, and RNQ0103 is how the RPG runtime reports it when the program didn't handle status 00103.
Which reply should I give to an RNQ message?
C (cancel) is the safe answer when you don't know the program. D and F also cancel, but first write a dump the developers can use. G skips the rest of the current RPG cycle and resumes at its input step (*GETIN). That is a call for the program's owner to make.