Use the Monitor op-code before the statement.
You will need an On-Error section for any errors along with an EndMon to close.
/Free
Monitor;
Eval Result = %Dec(Field);
On-Error;
Eval Result = *Zero;
EndMon;
/EndFree
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer
V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions
Implementer V5R3
----- Original Message ----
From: Tim Gornall <tgornall@xxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Sent: Thursday, June 14, 2007 5:40:57 PM
Subject: How to ignore a statement error in RPGLE?
I am using %DEC within an RPGLE program to convert the character data to
numeric. Sometimes the data being converted is not valid for numeric. If
the statement errors, how can I ignore it and continue to the next
statement? Similar to MONMSG in CL, or the TRY block in java? Thanks, Tim
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.