× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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) )
RETURNS DATE
LANGUAGE RPGLE
SPECIFIC GARVEY/DT2ISOSRV
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
NO EXTERNAL ACTION
NOT FENCED
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...

For example...
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
correct.

Any thoughts?



-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Monday, March 04, 2013 5:38 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Help with debugging external UDF

On 04 Mar 2013 14:37, Thomas Garvey wrote:
<<SNIP>>
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
catalogs.

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.

--
Regards, Chuck
--
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,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.