by steve-myers » Mon Dec 17, 2012 4:02 am
I have to agree with Prino. If I read the first two posts correctly, the TS want to submit a job, wait for the job to complete, and then - somehow - retrieve the max RC for the job.
Mehdi shri: the system does not work that way. When you submit a job it becomes totally independent of the TSO user that submitted the job. The TSO user that submits the job has no control over when, or where, the job executes, and there is no defined way for the job to communicate with the TSO user that submitted the job. The job completion message the TSO user may receive is sent in a way that does not permit the TSO user from intercepting the message.
If you really want return code information, you can use TSO ALLOCATE commands to simulate the DD statements, and the CALL command to run the batch program in your TSO environment. A Rexx EXEC can use the RC variable to retrieve the return code from the CALL command, which is the return code of the batch program started by the CALL command. All this assumes the batch program can run in your TSO environment - most batch programs can - and on the system where your TSO session is running. Now whether your installation management will permit such foolishness is another issue which I will not address here.