|Your UDF expects an Integer value, but in your RPG program you are passing a packed numeric value.
SQL functions can be overloaded, that means the multiple functions with the same name but different parameter definition can coexist within the same schema/library.
That means a function with a packed parameter is searched, but not found! Convert either your function to expect a packed numeric parameter or define your host variable as Integer or convert your packed data into an integer value before calling the function.
BTW you do neither need a binding directory nor insert the UDF into any binding directory nor specify the UDF service program directly within the compile command. SQL functions are searched and called dynamically.
But why using an UDF, why not simply creating a view with an additional columns with the case clause?
Something like this:
Create View YourSchema/YourView as
case when crnted < 10 then concat('20000',cast(crnted as char(4)))
when crnted <=13 and crnted >= 10
then concat('2000',cast(crnted as char(4)))
when crnted < 1000 then concat('200',cast(crnted as char(4)))
when crnted >= 5300 then concat('19',cast(crnted as char(4)))
when crnted < 5300 then concat('20',cast(crnted as char(4)))
from bkmast a;
This view can be called as follows:
Where isbn18 = YourValue;
Or within an embedded SQL Command:
Exec SQL Select NewColumn into :YourRtnVar
Where isbn18 = :YourHostVar;