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



Hey Vern,

Just managed to get a hold of the source for my debug utility

Attached is a text file containing the source for 3 objects:

STRSRVDBG *CMD
ENDSRVDBG *CMD
SRVDGC *PGM

Just split out the separate bits of source into their own members and
compile.

Hope you find it useful!

Rory

On Thu, Sep 4, 2014 at 10:04 AM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
wrote:

Hi Rory

That sounds cool, likely works really well when you know the job you are
debugging - whereas SEP breakpoints - set using SBREAK in a debug session -
help when you don't know the job.

Your program could be useful in the secondary job where one has to
STRSRVJOB and STRDBG with information that is displayed when a breakpoint
is reached.

Vern

On 9/4/2014 10:45 AM, Rory Hewitt wrote:

I ended up creating a command and CL program called STRSRVDBG (Start
Service Debug) - it's a combination of STRSRVJOB and STRDBG, but allowing
job/program selection. I will dig out the source if anyone wants it, but
it's pretty easy to write your own, and *very* useful if you need to do
lots of green screen batch program debugging...


On Thu, Sep 4, 2014 at 6:04 AM, RPG List <rpglist@xxxxxxxxxxx> wrote:

Thanks Scott and everyone.

I used the sep in green for now and it was due to the program compile
issue.

Sorry to be so stupid last night :)

Sent from my iPhone

On Sep 3, 2014, at 9:01 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>

wrote:

Or even if you don't have RDi available, using a service entry point

(SEP) might help you out here.

Even in the green-screen STRDBG, you can use a SEP. It's much more

clumsy/cumbersome than doing a SEP via RDi, but if RDi isn't available,
it's still an easy way to make sure you find the right STRSRVJOB to run.

As for why the STRSRVJOB isn't working -- my guess is that the program

is just never hitting the breakpoint that was set. i.e., it's not doing
what you expect :-)



On 9/3/2014 10:01 AM, David Gibbs wrote:

On 9/3/2014 8:44 AM, RPGLIST wrote:
The problem is I need to run it in debug to check some values that
are calculated during run time, but even using STRSRVJOB doesn't seem
to be working.

If you have RDi available, I would suggest using a service entry point

debug.

david

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




CMD PROMPT('Start service debug')

/*T: Start service debug */
/*O: PGM(SRVDBGC) */

JOB: PARM KWD(JOB) TYPE(QJOB) MIN(1) Prompt('Job name')
QJOB: QUAL TYPE(*NAME) LEN(10)
QUAL TYPE(*NAME) LEN(10) PROMPT('User')
QUAL TYPE(*CHAR) LEN(6) RANGE(000000 999999) +
PROMPT('Number')

PGM: PARM KWD(FILE) TYPE(QPGM) MIN(1) PROMPT('Program +
or service pgm')
QPGM: QUAL TYPE(*NAME) LEN(10)
QUAL TYPE(*NAME) DFT(*LIBL) SPCVAL((*CURLIB) +
(*LIBL)) PROMPT('Library')

OBJTYPE: PARM KWD(OBJTYPE) TYPE(*CHAR) LEN(7) RSTD(*YES) +
DFT(*PGM) SPCVAL((*PGM) (*SRVPGM)) +
PROMPT('Object type')

=======================================================================

CMD PROMPT('End service debug')

/*T: End service debug */
/*O: PGM(SRVDBGC) */

JOB: PARM KWD(JOB) TYPE(*CHAR) LEN(26) +
CONSTANT(*ENDSRVDBG)
PGM: PARM KWD(PGM) TYPE(*CHAR) LEN(20) CONSTANT(' ')

OBJTYPE: PARM KWD(OBJTYPE) TYPE(*CHAR) LEN(7) CONSTANT(' ')

=======================================================================

PGM PARM(&QJOB &QPGM &OBJTYPE)

/*T: Start service debug */
/*I: QCMPSRC,CRTBNDCL */

DCL VAR(&QJOB) TYPE(*CHAR) LEN(26)
DCL VAR(&QPGM) TYPE(*CHAR) LEN(20)
DCL VAR(&OBJTYPE) TYPE(*CHAR) LEN(7)

DCL VAR(&JOB) TYPE(*CHAR) LEN(10)
DCL VAR(&USER) TYPE(*CHAR) LEN(10)
DCL VAR(&NBR) TYPE(*CHAR) LEN(6)
DCL VAR(&PGM) TYPE(*CHAR) LEN(10)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)

/*-------------------------------------------------------------------*/

MONMSG MSGID(CPD0000 CPF0000) EXEC(GOTO CMDLBL(ERROR))

/*-------------------------------------------------------------------*/

/*?Parse out qualified parameters and use defaults where necessary?*/

CHGVAR VAR(&JOB) VALUE(%SST(&QJOB 1 10))
CHGVAR VAR(&USER) VALUE(%SST(&QJOB 11 10))
IF COND(&USER = ' ') THEN(CHGVAR &USER '*N')
CHGVAR VAR(&NBR) VALUE(%SST(&QJOB 21 6))
IF COND(&NBR = ' ') THEN(CHGVAR &NBR '*N')

CHGVAR VAR(&PGM) VALUE(%SST(&QPGM 1 10))
CHGVAR VAR(&LIB) VALUE(%SST(&QPGM 11 10))
IF COND(&LIB = ' ') THEN(CHGVAR &LIB '*LIBL')

/*?End any current debugging?*/

ENDDBG
MONMSG MSGID(CPD0000 CPF0000) EXEC(RCVMSG +
MSGTYPE(*EXCP) RMV(*YES))
ENDSRVJOB
MONMSG MSGID(CPD0000 CPF0000) EXEC(RCVMSG +
MSGTYPE(*EXCP) RMV(*YES))

IF COND(&JOB = '*ENDSRVDBG') THEN(DO)
GOTO CMDLBL(ENDPGM)
ENDDO

/*?Start servicing the specified job?*/

STRSRVJOB JOB(&NBR/&USER/&JOB) DUPJOBOPT(*SELECT)

/*?Start debug on the specified program or service program?*/

IF COND(&OBJTYPE = *SRVPGM) THEN(DO)
STRDBG SRVPGM(&LIB/&PGM)
ENDDO
ELSE CMD(DO)
STRDBG PGM(&LIB/&PGM)
ENDDO

GOTO CMDLBL(ENDPGM)

/*-------------------------------------------------------------------*/

ERROR:
CALL PGM(QMHMOVPM) PARM(' ' '*DIAG' +
X'00000001' '*PGMBDY ' X'00000001' +
X'0000000800000000')
CALL PGM(QMHRSNEM) PARM(' ' X'0000000800000000')

/*-------------------------------------------------------------------*/

ENDPGM:
RMVMSG CLEAR(*ALL)
MONMSG MSGID(CPF0000)
ENDPGM

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.