Thank you. But what if API returns a different error message whose data
value is not Binary ?

Mohan Eashver

On Fri, Oct 12, 2018 at 9:33 AM David Gibbs <david@xxxxxxxxxxxx> wrote:

On 10/12/2018 8:09 AM, Mohan Eashver wrote:
How can the first 4 bytes of the Data structure that are a binary value
converted to a number ?
I am getting this error when i do the following :
A character representation of a numeric value is in error (C G D F).
RPG statement performed a conversion from character to numeric using data
that was in error.

d ErrorInfo 240A
d Bin4 S 10I 0 INZ

I would suggest you use a data structure for ErrorInfo instead of a
character field.

Something like this:

dcl-ds ErrorInfo qualified;
reason int (4);
rule char (15);

reasonCode = ErrorInfo.reason;
rule = ErrorInfo.rule;


David Gibbs

IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding 615 miles (Yes, you read that right) in the American Diabetes
Association's Tour de Cure to raise money for diabetes research, education,
advocacy, and awareness. You can make a tax deductible donation to my ride
by visiting

See where I get my donations from ... visit for an interactive map (it's a geeky

I may have diabetes, but diabetes doesn't have me!
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by 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].