BINGO
Holy crap
I thought I read somewhere that DECIMAL and NUMERIC were somewhat interchangeable
Well - I guess not - 10 dope laps to me on this one
I want to thank EVERYONE who replied on this
This is what I ended up with
CREATE FUNCTION PRODPA.EBSCST (
CHAR(4),
CHAR(6),
CHAR(2),
NUMERIC(2, 0),
CHAR(2),
CHAR(1),
CHAR(2) )
RETURNS NUMERIC(21, 6)
LANGUAGE RPGLE
SPECIFIC PRODPA.EBSCST
DETERMINISTIC
NO SQL
NO EXTERNAL ACTION
DISALLOW PARALLEL
NOT FENCED
EXTERNAL NAME 'PRODPA/ITMMSTSP(GETSTDCOST)'
PARAMETER STYLE GENERAL
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of dlclark@xxxxxxxxxxxxxxxx
Sent: Thursday, January 11, 2018 10:59 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: RE: Pointer error when calling external function
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 01/11/2018 09:55:04
AM:
I am having the EXACT same problem
Here is my function
CREATE FUNCTION PRODPA.EBSCST (
CHAR(4),
CHAR(6),
CHAR(2),
DECIMAL(2, 0),
CHAR(2),
CHAR(1),
CHAR(2) )
RETURNS DECIMAL(21, 6)
LANGUAGE RPGLE
SPECIFIC PRODPA.EBSCST
DETERMINISTIC
NO SQL
RETURNS NULL ON NULL INPUT
NOT FENCED
EXTERNAL NAME 'PRODPA/ITMMSTSP(GETSTDCOST)'
PARAMETER STYLE GENERAL
As someone pointed out - I forgot to commit after creating this - yet
another Homer Simpson episode
Here is the module in the service program
P GetStdCost b export
D GetStdCost pi 21s 6
D Suffix 4A const
D Skuno 6A const
D LblCode 2A const
D Prefix 2S 0 const
D UOM 2A const
D EnvCode 1A const
D Type 2A const
You are using DECIMAL definitions in your function but using S
(zoned) definitions in your PI. Change your function to use NUMERIC definitions.
Sincerely,
Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300
Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331
*********************************************************************************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary information. If you have received this message in error, please immediately notify the sender and delete and destroy the message and all copies. All unauthorized direct or indirect use or disclosure of this message is strictly prohibited. No right to confidentiality or privilege is waived or lost by any error in transmission.
*********************************************************************************************
--
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,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.