× 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.



Walter,
Try this:
Using SBREAK.
Do *not* use the STRSRVJOB at the start of your test.
use the STRDBG and SBREAK as you have already noted.
run your SQL statement - you should receive an INQ message in your session
indicating that the service break point has been reached and in the second
level text, it will give you the fullly qualified job name.
start a *new* session and plug that job name into the STRSRVJOB cmd
then issue a STRDBG on the service program and you will see the program at
the point where it stopped.
issue the BREAK (F6) commands where you want the pgm to stop.

Return to your *original* session, which is still sitting at the *INQ
message and press ENTER - This allows the job to continue.
Switch back to your debug session and watch the pgm from there.

when you are done, you can enddbg and endsrvjob on the second session, and
if you no longer need to debug the service program, issue the enddbg on the
original session.

Jeff Young
Sr. Programmer Analyst


On Fri, Feb 28, 2014 at 1:49 PM, Walter Bellisio <wbellisio@xxxxxxxxxxx>wrote:

Hi Vernon,

We're on V6.1. I'm attempting to debug the iDate UDF that Alan Campin has
so kindly shared. I'm just running a simple select statement from a
STRSQL. I've attempted these two scenarios:

I've tried it with BREAK as follows:

- Session 1: STRSRVJOB JOB(123456/MYUSERID/SESSION2)
- Session 1: STRDBG UPDPROD(*YES) SRVPGM(QGPL/XVIDAT)
- Session 1: BREAK on the first statement of each procedure in both
modules XVIDAT_M01 and XVIDAT_M02.
- Session 2: STRSQL
- Session 2: select idate(someDateField) from someTable

Dates are shown edited, but none of the breakpoints occur.


I also tried it with SBREAK as Alan had suggested as follows and also no
luck:

- Session 1: STRDBG UPDPROD(*YES) SRVPGM(QGPL/XVIDAT)
- Session 1: "sbreak LINE# user MYUSERID" on the first statement of each
procedure in both modules XVIDAT_M01 and XVIDAT_M02.
- Session 2: STRSQL
- Session 2: select idate(someDateField) from someTable

Alan states: " It will break on your previous statement and tell you the
STRSRVJOB command to use on another session. Then issue STRDBG in that
session."

It did not break. I also tried substituting sbreak LINE# user MYUSERID in
the first scenario, and no luck.

Walter


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Vernon Hamberg
Sent: Thursday, February 27, 2014 7:22 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Debugging a UDF on V6.1

Walter - if you're willing, tell us just what steps you took? What release
of the OS are you on? SBREAK would get you what you want, but it is a
relatively recent thing - v5r3 or v5r4.

If you used SBREAK, you have to set the user you want - that is often
QUSER for server jobs - so which user did you specify?

I forget now about UDFs, but I think SQL could be doing things in a server
job, not your own - again, you'd have a hard time figuring which job to
debug unless you can use SBREAK.

Hope to help!
Vern

On 2/27/2014 3:01 PM, Walter Bellisio wrote:
Thanks for all of your responses. Still can't get a breakpoint to come
up. I know the function is working because it is converting the dates as
described. In response to Peter, the service program only exists in QGPL,
and the CREATE FUNCTION qualifies the service program. Was there a PTF
that may have been needed?

Walter



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Thursday, February 27, 2014 1:56 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Debugging a UDF on V6.1

I should clarify that more. In one session just do a STRDBG and then
issue a SBREAK for the line you want to break and your user id. Then in
another session, run your SQL. It will break on your previous statement and
tell you the STRSRVJOB command to use on another session. Then issue STRDBG
in that session.


On Thu, Feb 27, 2014 at 11:46 AM, Walter Bellisio <wbellisio@xxxxxxxxxxx
wrote:

I'm attempting to debug a User Defined Function that uses a service
program to do the work on a V6.1 release. This is the iDate source
downloaded from A. Campin, with the modules, service program and
functions created properly. STRSRVJOB and STRDBG are done on one
session, and a simple STRSQL with a select statement that uses the
UDF is done on the other session that the STRSRVJOB points to. A
break point was set on the first statement of every procedure in both
modules and I can't get a module to stop at any of the break points.
The RPGLE modules of the service program were also compiled with
DBGVIEW(*ALL) and that did not work as well. Has anyone encountered a
similar problem?

Walter
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.