× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Vern,

Thanks for the response! It is not a key. I haven't even been able to test any type of record access...since it fails at the 'register' call.

Thanks,
Nathan Hughes
Software Developer


601.499.2131 Office
280 Trace Colony Park
Ridgeland, MS 39157

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vernon Hamberg
Sent: Monday, March 23, 2020 6:59 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: FieldProc Error - column has returned invalid data on a Zoned Numeric column

Nathan

Is the numeric column in question a key of the file? Are you using native record-level access? If either, then RPG might give you problems.
I thought it was only with keyed columns, but maybe not.

You might try using SQL to process the file.

Vern

On 3/23/2020 3:26 PM, Nathan Hughes wrote:
First I want to apologize for my ignorance in RPGLE...we typically don't use this programming language, but have to for FieldProc purposes. I've researched this issue for a couple weeks now, and cannot find a resolution. I'm currently trying to write a field procedure program. I have taken the IBM RPGLE example (https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ibm.com%2Fsupport%2Fknowledg...yfpexample.htm&amp;data=01%7C01%7Cnathan.hughes%40badgepass.com%7Cf1bcde703e364a51e0e508d7cf84a7ec%7C224758f072634e52a6e4f5db2afdf99e%7C0&amp;sdata=JowWXW22XBShdn%2BFHGSK3hwnyq%2FhcrAxCr0h3rBrE0Y%3D&amp;reserved=0<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ibm.com%2Fsupport%2Fknowledgecenter%2Fssw_ibm_i_73%2Fsqlp%2Frbafyfpexample.htm&amp;data=01%7C01%7Cnathan.hughes%40badgepass.com%7Cf1bcde703e364a51e0e508d7cf84a7ec%7C224758f072634e52a6e4f5db2afdf99e%7C0&amp;sdata=pp0Vs8gQJDaB7mrLo3MtiU3XsbbAlXkyAso5sqhcmDY%3D&amp;reserved=0>), and started to modify it to work for us.
Here is the table that was created for testing purposes:
********** Beginning of data *************************************
A R REC
A ECNUM 16S 0 COLHDG('NUMBER')
A ALIAS(EC_NUMBER)
A ECALPHA 32A COLHDG('ALPHA')
A ALIAS(EC_ALPHA)
************* End of data ****************************************
The program from the link above allows for several SQL types, clob, varchar, char, blob, etc., but I needed to add zoned numeric. To begin, I studied and stepped through the program to see what it was doing, and thought I had a good understanding of how it worked. I then started adding what appeared as necessary for the SQL_TYP_ZONED (488).

When I send the 'ALTER TABLE' command and set the FieldProc program on a column, the first call is to Register(function code: 8), the next is Encode(function code: 0) to encode the values in said column.
I set a breakpoint at the end of the program, and evaluated the parameters when setting the FieldProc on a VARCHAR and ZONED NUMERIC columns, and besides being different data types all appears correct, but the ZONED NUMERIC column abruptly stops with the error below after the register call.

Message ID . . . . . . : SQL0685
Date sent . . . . . . : 03/18/20 Time sent . . . . . . : 16:17:04

Message . . . . : Field procedure on column ECNUM has returned invalid data.

Cause . . . . . : Field procedure on column ECNUM has returned invalid data.
Recovery . . . : Change the field procedure to return valid data.

Thank you in advance for any help you can give on this.

Thanks,
Nathan Hughes
Software Developer

[BadgePass]
601.499.2131 Office
280 Trace Colony Park
Ridgeland, MS 39157

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&amp;data=01%7C01%7Cnathan.hughes%40badgepass.com%7Cf1bcde703e364a51e0e508d7cf84a7ec%7C224758f072634e52a6e4f5db2afdf99e%7C0&amp;sdata=PzPJ9RRrdGX%2FzDZE%2BDghIB7kgbEHCw3KVEDv1ZggipE%3D&amp;reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&amp;data=01%7C01%7Cnathan.hughes%40badgepass.com%7Cf1bcde703e364a51e0e508d7cf84a7ec%7C224758f072634e52a6e4f5db2afdf99e%7C0&amp;sdata=yvfUJ%2B9qCPC1%2FyCvZXjJIhW1NwLThcDcBkvJJ5FajHo%3D&amp;reserved=0.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com&amp;data=01%7C01%7Cnathan.hughes%40badgepass.com%7Cf1bcde703e364a51e0e508d7cf84a7ec%7C224758f072634e52a6e4f5db2afdf99e%7C0&amp;sdata=UCq%2BLFL8SUxFLFF2hmCsKphpuXsnl8vzu9EeNsi3skU%3D&amp;reserved=0
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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