I've written an RPG program, (not service program), and wrappered it as
an SQL external UDF.
I pass in a string, length, and # of decimal places.
It will format a number (string), according to the length and # of
decimal places that i pass in and return the formatted string.
I made all parameters and the return parameter character.
The create function is here -
CREATE FUNCTION JRPERS/MYEDIT
( pInput Char( 15 ),
pRtnValLen Char( 2 ),
pDec Char( 1 ) )
Returns Char( 15 )
External Name JRPERS/MYEDIT
Language RPGLE
No SQL
Parameter Style SQL
In order to test it from interactive sql, i have to use this -
SELECT '1234567', myedit(CHAR(1234567),CHAR(07),CHAR(2))
FROM sysibm/sysdummy1
which (correctly) yields this -
....+....1....+....2....+....3.
Constant value MYEDIT
1234567 12345.67
******** End of data ********
What I can't understand is when I try to run it thus -
SELECT '1234567', myedit('1234567','07','2')
FROM sysibm/sysdummy1
I get this error -
MYEDIT in *LIBL type *N not found.
From reading on the lists, it 'sounds' like a parm mismatch BUT,
everything is character.
Any direction or tips would be greatly appreciated?
We are at v5r4 here.
tia John B.
fyi
The reason for this hoop-jumping is so that I can call it from Extol EBI
edi software for editing character (number) values. The only other
way to do it, from their software, would be write it in java. afaik.