I have an interactive RPGLE program ,PGMA, that calls another RPG program, RPG3P, based on a parameter and that job is not interactive. If RPG3P aborts how can I find out what the error mesage was? The job log does not give enough information to help find the problem.
Software/Hardware used:
V5R4
ASKED:
October 12, 2009 2:58 PM
UPDATED:
October 14, 2009 1:41 PM
> …and that job is not interactive.
That seems to indicate that PGMA doesn’t call RPG3P. Instead, it makes it seem like PGMA submits a batch job that calls RPG3P. The spooled joblog of that batch job doesn’t give you enough information to learn why the abort happened.
Does that describe your situation? If not, can you tell us more?
Tom
I’m sorry if my question was a little confusing. Below is parts of the CL (EDPROC) that is called interactively and the RPG program that it calls to run a third job job. The called job at (A) can be RPG or CL. I would like to be able to get enough info to determine the cause of a problem if the called program at (A) aborts.
EDPROC (CLLE program)
call pgm(eod_job_P) parm(‘CMLSTSPEC ‘ &testout)
——————————————————————–
EOD_JOB_P (RPGLE program)
d eod_job_p pi
d pgmname 10a const
d status 1a options(*nopass)
d brl 1a options(*nopass)
d whs 1 0 options(*nopass)
eodjobnam = pgmname;
exsr RunTheJob;
if PassStatus;
status = WrkStatus;
ENDIF;
return;
//———————————————————–
begsr RunTheJob;
/end-free
c call(e) eodjobnam (A)
/free
select;
when %status = 202 or %status = 231 or %status = 232;
wrkstatus = ‘H’;
exsr senderrmsg;
when %status = 211;
wrkstatus = ‘I’;
exsr senderrmsg;
other;
wrkstatus = ‘C’; // Completed
endsl;
endsr;
//———————————————————————-
begsr senderrmsg;
select;
when wrkstatus = ‘H’; // Called Job Failed/Halted
cmd = teststatus+’-EDPROC Called Program ‘+%trim(eodjobnam)+
‘ failed for branch ‘+wrkbrl+%char(wrkwhs)+’. Examine +
the job log before answering. Job Stopped. +
Status = H’;
exsr email;
exsr errlog;
when wrkstatus = ‘I’; // Error Calling program
cmd = teststatus+’-EDPROC Error calling program ‘+%trim(eodjobnam)+
‘ for branch ‘+wrkbrl+%char(wrkwhs)+’. Job Stopped. +
Status = I’;
exsr email;
exsr errlog;
endsl;
endsr;
That job is running interactive.
You should be able use DEBUG to step into it and determine error.
also if you CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES)
you should get all the information you need.
Given everything so far, CharlieBrowne is right. Everything should be visible in the interactive joblog when EDPROC ends. A DSPJOBLOG command at that point should show everything. (Assuming that CMLSTSPEC put messages into the joblog and that other programming that’s left out didn’t remove the messages.)
You might get by with:
Whether anything gets spooled or not will depend on how the job logging levels are set and how messages are handled in the programming. (I wouldn’t expect them to be removed.)
The logging level might be set automatically. However, you might not want to trust that. You can put:
to set the level before calling eod_job_P. That sets the level so that DSPJOBLOG is more sure to have something useful to print. (Add [LOGCLPGM(*YES)] to the CHGJOB command if you need to see any CL commands that might be in there.)
What is the purpose of the eod_job_P program? It doesn’t seem to do anything that couldn’t be done directly in EDPROC.
Tom
Tom and Charlie, Thank you for your feedback. I will use these ideas.