IBM i message

MCH1210: Receiver value too small to hold result

MCH1210 (Receiver value too small to hold result) means a calculation or numeric move on IBM i produced a value with more digits than the receiving field can hold. The machine stops the instruction instead of storing a cut-down number.

Other names for this code

Also written as MCH1210 error, MCH1210 receiver value too small, receiver value too small to hold result, MCH1210 RPG, MSGID MCH1210.

What it means

Every numeric field has a fixed size. A packed field of 5 digits with no decimals holds at most 99999. When an instruction produces a value that needs more digits than the receiver has, it can't store the result without dropping the high-order digits. The machine raises MCH1210 and stops the instruction instead of storing a wrong number.

Only lost high-order digits count. Decimals that don't fit are dropped or rounded according to the program's rules and don't cause MCH1210.

MCH1210 is an escape message sent to the program that ran the instruction. An ILE RPG program reports it as status 00103, an intermediate result too large for its field, and shows inquiry RNQ0103 if nothing handles it. Other languages end in their own inquiry or in function check CPF9999.

Common causes

  • A counter, total or sequence number outgrew its field. A 4-digit counter is fine for years and then fails on the day it reaches 10000.
  • An expression assigns a large value to a smaller field, for example an RPG EVAL that moves a 9-digit total into a 7-digit field.
  • Data volume grew. A file now has more records than a record-count or relative-record-number field allows for, or amounts grew past the size the program was written for.
  • A conversion such as RPG %DEC or %INT was given a value larger than the target size.
  • Bad input, such as a quantity keyed with extra digits, pushed an otherwise safe calculation over the limit.

How to find the problem

  1. Run DSPJOBLOG, put the cursor on MCH1210 and press F1, then F9. The message details name the program, module, procedure and statement.
  2. Look at the receiving field in that statement and compare its length and decimals with the values that feed it.
  3. Debug with STRDBG, stop on the statement and display the input values. The size of the result usually makes the problem obvious.
  4. If the program has run for a long time without trouble, look for a field that grows, such as a counter, a running total or a record number.

How to fix it

  • Make the receiving field larger and recompile. If the field is in a file or a shared data structure, change every program that uses it.
  • Check the value before you store it, and handle values that are too large in a way the business accepts, such as an error message or a capped value.
  • Reset or roll over counters that are meant to wrap, on purpose and in code.
  • In RPG, wrap the calculation in a MONITOR group and handle status 00103, so one oversized value doesn't stop a batch job.
  • Note that older fixed-form RPG operations such as ADD and Z-ADD can truncate silently, depending on the TRUNCNBR setting, while expressions always raise the error. Don't make a program pass by turning on truncation.

What it looks like

Receiver value too small to hold result.

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(MCH1210) MSGF(QSYS/QCPFMSG)

Also inspect the full job log and second-level message text, including substitution values.

Report a correction to WND Software.

Questions

Why did a program that worked for years suddenly get MCH1210?

A value finally outgrew its field. Counters, totals and record numbers are the usual suspects, because they keep growing until one day they need one more digit.

Does MCH1210 mean decimals were lost?

No. It is about high-order digits on the left. Decimal places that don't fit are handled by truncation or rounding and don't cause MCH1210.

What RPG status code matches MCH1210?

ILE RPG reports it as status 00103, an intermediate result that is too large for its field. The inquiry message is RNQ0103.