Bryan's RPG IV Journal
Receiver Too Small to Hold Result
Q. I have programs that sometimes force a field defined larger than the result field. Of course I get the RNQ0103 message ("Target for a numeric operation is too small to hold result"). Is there a work-around or am I forced to end-free and do this operation and return to free?
A. This problem will occur with the EVAL operation, regardless of whether or not you are using free format RPG.
You could use the Monitor operation to watch for this error, which RPG can catch as a status code of 103:
A. This problem will occur with the EVAL operation, regardless of whether or not you are using free format RPG.
You could use the Monitor operation to watch for this error, which RPG can catch as a status code of 103:
D Tgttoosmall C 103In this example, if the value of Source is too large to fit into Result, the On-error statement will catch the error. I've used a named constant to hold the relevant status code, 103. Following the On-error statement, you can include whatever code you want to handle the exception.
Result S 11 2
Source S 15 2
/Free
Monitor;
Result = Source;
On-error Tgttoosmall;
...
// Process exception here
...
Endmon;
/End-free
Log of Journal Entries |
|
Use this scrollable blog map to view other journal entries: |
|
| It is your responsibility to ensure procedures, techniques, and code used from this website are accurate and appropriate for your installation. No warranty or support is implied or expressed. |
![]() |
| Privacy and Email Policy |
| AS/400®, eServer, i5/OS, IBM i, Integrated Language Environment®, iSeries, OS/400®, RPG/400®, System i5, VisualAge®, and WebSphere® are trademarks of IBM Corporation. Note: IBM® System i is the latest member of the family of eServer iSeries. This site might refer to System i as System i5, iSeries, or AS/400. |
|
If you are having trouble navigating the menu at the top of this page, you may use the following scrollable site map instead: |
|
|











International visitors: