Statement of Problem:
=====================
When invoking TSO/E commands from a batch COBOL program using the IKJTSOEV / IKJEFTSR methodology; and attempt to process the data that was
captured in the //SYSTSPRT output, we "sometimes" get S001 Reason 0004 ABENDs. I say sometimes, because most of the times, we
do not ABEND. Like just now, I ran the process 150 times (not concurrently) and only 2 of those invocations ABENDed.
Background
===========
We have successfully tested batch COBOL programs that are able to in turn, invoke TSO/E commands in batch:
To carry this out, we use the already proven two-fold recommended methodology of:
(1) dynamically calling the IKJTSOEV IBM service to establish a TSO environment.
(2) dynamically calling the IKJEFTSR IBM service utility to perform the desired TSO/E command.
The above methodology has been successfully tested for a number of TSO/E commands such as "LISTALC STATUS", "LISTC LVL" and even dynamic file allocation.
For those commands that produce a listing (such as LISTALC STATUS, or LISTC LVL), the output is viewable in the //SYSTSPRT DD SYSOUT=* output.
We are even able to "push the envelope" and process the //SYSTSPRT output within the same COBOL program and step. We do this, by coding in the JCL something like:
//SYSTSPRT DD DSN=&&TEMP,DISP=(NEW,PASS) - and in turn, adding to the COBOL program FILE CONTROL and FD statements to recognize the SYSTSPRT file.
After the call to IKJEFTSR is complete, we issue COBOL "CANCEL" statements for the IKJTSOEV and IKJEFTSR invocations. We then follow that by
OPENING the SYSTSPRT file for INPUT, READING through the file to process the records, and then CLOSING the file. As mentioned in the beginning,
this works most of the time. But for an extreme minority of invocations, we experience a "ABEND=S001 U0000 REASON=00000004" abend.
Even when it ABENDs, most of the SYSTSPRT file has been processed and the ABEND happens just before the end-of-file condition.
It would appear that the ABEND is happening in the calling COBOL program just after it has read the final record in the //SYSTSPRT file.
We have been testing with the "LISTALC STATUS" and "LISTC LVL" TSO/E commands, and both types of invocations produce these intermittent
ABENDs.
Our systems people have a theory that maybe TSO is not being totally shut-down within the COBOL program's execution and there is some
contention on the //SYSTSPRT file. I think there might be some contention between different resources but I am not sure.
Can anyone offer any assistance as to what tweaking we should do to ward off these intermittent ABEND's.
thanks in advance.
twolights58