Finally got back to this after a few days...
I executed a DROP function command and then a CREATE FUNCTION, verified the
function is defined in my library (using Navigator).
Here's the CREATE...
CREATE FUNCTION GARVEY/DT2ISOSRV (
TESTVALUE VARCHAR(50) ,
DATEFMT VARCHAR(4) )
CALLED ON NULL INPUT
NO EXTERNAL ACTION
EXTERNAL NAME 'GARVEY/DATE2ISO(DATE2ISO)'
PARAMETER STYLE GENERAL ;
I am trying to debug the function when it gets called by SQL, so I am adding
the Service Program (DT2ISOSRV) to my program list and setting a break point
(in DATE2ISO module). I know the function is getting called because my job
log is filled up with messages that the calls to CEEDATE (which is called
from within the function) are failing...
Timestamp picture mismatch.
The value for month is not valid.
The problem is that I can't get it to stop at my breakpoints. I suppose
that I am probably setting breaks in something OTHER than what is actually
being called, but I thought I dealt with that by dropping the function and
then CREATEing it again.
I did look at the SYSFUNCS and SYSROUTINES files and everything looks
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Monday, March 04, 2013 5:38 PM
Subject: Re: Help with debugging external UDF
On 04 Mar 2013 14:37, Thomas Garvey wrote:
The system does call something because each step of the original
program returns a zero in SQLCOD, AND it returns a value from the UDF.
The problem is the value is wrong and I can't get to debug the service
program to find what is going wrong.
I am not sure I understood what was being done to effect debugging, but
it seems what is described for the batch job attempts to suggest that the
UDF code being run in the batch job, is not the code being debugged; i.e.
the breakpoint in the code chosen to debug was never hit.
For that... The output from a TRCJOB would show what specific code was
being run; and presumably would be again on the next run.
Consider that the library list is less relevant if the SQL PATH is not
*LIBL, and furthermore if the EXTERNAL NAME for the routine directs to a
specific [a qualified] service program name [which could be outside of the
library list]. What specific version of the function being invoked is the
first thing to determine, then what that function defines to be invoked.
Library qualifying the function is best to ensure the former, and that also
makes finding-out the latter easier, by a very specific query of the
The CREATE FUNCTION was not offered nor any variants either for SPECIFIC
name or SOURCED; i.e. there might be overloaded or effective duplicates
defined. Verify the routine definition(s) in SYSFUNCS or SYSROUTINES.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l