I have a service program procedure that returns the calling program using QMHRCVPM and QMHSNDPM apis. I am trying to wrap it in a udf and it is not working, always returns blank. Wondering if this for some reason does not work with SQL. I have tried quite a few different startcnt also tried converting them to integer in sql.
Code:
//UDF create create or replace function misjd/miscp_getcaller (startcnt integer) returns char(10) language rpgle no sql external name 'MISJD/MISCPR01(MISCP_GETCALLER)' parameter style general //procedure definition. Dcl-Proc MiscP_GetCaller Export; Dcl-Pi *n Char(10); StartCnt Int(10) Const; End-Pi; //this works. programname = miscp_getcaller(2); dsply programname; //But this does not Exec Sql Select Miscp_Getcaller(2) Into :Programname From Sysibm / Sysdummy1; dsply programname;
Comment