Page 1 of 1

REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 5:46 pm
by Sivapradeep
Hi,

I have a REXX program. In the begining of program i submitted a JCL ( using QUEUE stack ). after submission of this JCL, i have few REXX lines which depends on the output of the JCL that was just submitted. In my execution what's happening was by the time JCL finishes its execution the next few REXX lines were completed and always getting wrong output.
If i could make REXX execution to halt for a while till JCL finishes its execution and resuming immediately once the JCL finishes then i'll get correct output. Any suggestion for this ?

Hope i made it clear.

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 5:59 pm
by Akatsukami
Yes,I have a suggestion: don't even think about it. Idling about with your mainframe session locked up, waiting for a batch job to finish, is a career-limiting move. Capisce?

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 6:01 pm
by Sivapradeep
that's only the better suggestion i can get ? :(

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 6:05 pm
by BillyBoyo
Yes, pretty much.

The machine is not your machine. It is used by many people. If your program sits there "waiting" for a while, what are you going to do?

So, have the job NOTIFY you. Or send you an e-mail. Then you/whoever can start the next bit. Remember, that can even be hours later, depending on numerous factors.

Do some re-thinking remembering that a Mainframe is a machine for grown-ups, not something you just get to play on without regard to other, quality, teamwork, rationality, etc, etc, etc,

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 6:12 pm
by Sivapradeep
I agree with that......

I have some idea.. i think it will be fine. write a seperate JCL which has 2 steps.
In step 1: submitting JCL whatever i want in my REXX initial lines.
In step 2: based on step 1 RC = 0 , i can call the REXX using IKJEFT01.
so this is as good as REXX starting its execution after my initial step output.

i dont think this will be a problem to my machine.

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 6:14 pm
by Robert Sample
The best suggestion you can get is to break up the REXX so three's no waiting involved. Looping to wait for an event to happen wastes machine resources and prevents you from doing productive work on that terminal while waiting -- a double negative to management. Furthermore, if you're developing something that will be used in production, then you need to take advantage of the production tools (such as job scheduling) that already exist at your site. And, as Billy said, elapsed time is NOT under your control -- if your REXX executes just after a couple thousand jobs hit the system (I worked at one site where between 3 and 4 thousand jobs were dumped into the system by the job scheduler every day at 4 PM Eastern time), or your job needs a resource that is under exclusive control by another job that is running for hours, your terminal could be tied up for quite a while waiting for your job to finish.

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 6:24 pm
by Sivapradeep
Robert Sample wrote:The best suggestion you can get is to break up the REXX so three's no waiting involved.

I'll seperate the JCL part from my REXX and executes both of them seperately then.

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 6:43 pm
by BillyBoyo
Yes, that looks like a good way.

Re: REXX has to wait till JCL finish its execution

PostPosted: Fri May 11, 2012 8:05 pm
by mongan
Sivapradeep, I was going to suggest exactly what you have done, but you found the solution yourself within minutes after being told that your first solution would not work. Congratulations. Actually, I usually do it this way - I have a rexx that submits a job including the follow up rexx that will process the output from the job.