|
I have coded a simple batch debugging tool, which I regularly use. Why not try
this. I'm attaching the command and a CL program. It is easy to set it up.
Program: BTCHDBG (CLP)
PGM PARM(&PARM1 &PARM2 &PARM3 &PARM4)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(512)
DCL VAR(&PARM2) TYPE(*CHAR) LEN(3)
DCL VAR(&PARM3) TYPE(*CHAR) LEN(512)
DCL VAR(&PARM4) TYPE(*CHAR) LEN(10)
DCL VAR(&JOBATR) TYPE(*CHAR) LEN(1)
DCL VAR(&RQSTDTA) TYPE(*CHAR) LEN(3000)
DCL VAR(&CALL) TYPE(*CHAR) LEN(25) VALUE('CALL +
ITAPVS/BTCHDBG PARM(')
DCL VAR(&CALL1) TYPE(*CHAR) LEN(1) VALUE(')')
DCL VAR("E) TYPE(*CHAR) LEN(1) VALUE(X'7D')
DCL VAR(&USERID) TYPE(*CHAR) LEN(10)
DCL VAR(&RETRY) TYPE(*DEC) LEN(3 0) VALUE(0)
DCL VAR(&TIME) TYPE(*CHAR) LEN(6)
DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
RTVSYSVAL SYSVAL(QTIME) RTNVAR(&TIME)
CHGVAR VAR(&JOBNAME) VALUE('DBG' || &TIME)
RTVJOBA USER(&USERID) TYPE(&JOBATR)
IF COND(&JOBATR *EQ '1') THEN(DO)
STRSRVJOB JOB(&JOBNAME) DUPJOBOPT(*MSG)
MONMSG MSGID(CPF3536 CPF3520) EXEC(DO)
CHGVAR VAR(&RQSTDTA) VALUE(&CALL || "E || +
&PARM1 || "E || ' ' || "E || +
&PARM2 || "E || ' ' || "E || +
&PARM3 || "E || ' ' || "E || +
&PARM4 || "E || &CALL1)
SBMJOB JOB(&JOBNAME) JOBQ(&PARM4) RQSDTA(&RQSTDTA) +
LOG(*JOBD *JOBD *MSG) LOGCLPGM(*YES)
IF COND(&PARM3 *NE ' ') THEN(DO)
RETRY: CHGVAR VAR(&RETRY) VALUE(&RETRY + 1)
STRSRVJOB JOB(&JOBNAME) DUPJOBOPT(*MSG)
MONMSG MSGID(CPF3536) EXEC(DO)
IF COND(&RETRY *EQ 10) THEN(DO)
SNDMSG MSG('The job ' || &JOBNAME *TCAT ' is +
not active to perform the STRSRVJOB and +
the debug command. Perform the required +
command manually.') TOUSR(&USERID)
GOTO CMDLBL(ENDPGM)
ENDDO
GOTO CMDLBL(RETRY)
ENDDO
CALL PGM(QCMDEXC) PARM(&PARM3 512)
ENDDO
SNDMSG MSG('The job ' || &JOBNAME *TCAT ' is in +
debug mode. Once the job is completed +
end debug and the ENDSRVJOB manually.') +
TOUSR(&USERID)
GOTO CMDLBL(ENDPGM)
ENDDO
SNDMSG MSG('The job ' || &JOBNAME *TCAT ' +
exists more than once in the system. +
Kindly cancel the jobs and the +
corresponding output and retry the +
command again.') TOUSR(&USERID)
GOTO CMDLBL(ENDPGM)
ENDDO
IF COND(&PARM3 *NE ' ') +
THEN(DLYJOB DLY(&PARM2))
CALL PGM(QCMDEXC) PARM(&PARM1 512)
ENDPGM: ENDPGM
Command: BTCHDBGCMD (CMD)
CMD PROMPT('Job to Run')
PARM KWD(CMD) TYPE(*CHAR) LEN(512) MIN(1) +
PROMPT('Program to submit')
PARM KWD(DLY) TYPE(*CHAR) LEN(3) DFT(120) +
PROMPT('Enter delay time in *SECS')
PARM KWD(DBG) TYPE(*CMDSTR) LEN(512) MIN(1) +
PROMPT('Enter debug command')
PARM KWD(JOBQ) TYPE(*CHAR) LEN(10) DFT(QBATCH) +
PROMPT('Enter job queue')
Since I can have only one Command String in the program to submit I've defined
as a char string
of 512 bytes, and the debug parameter as 512 bytes which is the 3rd parameter.
Under the third parameter
you use STRDBG command.
Thanks
Venkat Sreenivasan
"Dass, Naveen" <Naveen.Dass@ps.net> on 11/01/99 10:20:49 AM
Please respond to RPG400-L@midrange.com
To: "'RPG400-L@midrange.com'" <RPG400-L@midrange.com>
cc: (bcc: Venkat Sreenivasan/IT/MIA/RCL)
Subject: RE: batch job debugging
madhusudhan
batch debug is cool,
1. hold the job queue.
2. sbmjob
3. Note the job details.
4. Strsrvjob
5. strdbg
6. Release the jobq
7. dspmodsrc
6. Add a break point.
7. Then its all yours.
and at the end dont forget to give a
8. Enddbg
9. Endsrvjob.
Hope this helps.
Naveen Dass
-----Original Message-----
From: Madhusudhana Perumal Iyah Guruswamy suresh
[mailto:igsuresh@wipsys.soft.net]
Sent: Monday, November 01, 1999 4:38 AM
To: RPG400-L@midrange.com
Subject: batch job debugging
Hi all,
how can we debug a batch job?.If someone knows please explain.
Thanks in advance.
Regards,
Suresh
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.