View previous topic :: View next topic
|
Author |
Message |
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
My requirement is, when my cobol program tries to open the input file, I have to throw an error message through the
cobol program.
What I tried was, I kept the dataset open, and submitted the JCL. The job went on HOLD, and started waiting for resources.
When I come out of the Input file and then release the job, the job completes, before i could go back and open the file.
Now is there a way I put some delay inside the program, which would give me time to open the input file, after the program
starts running ?
Cheers. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I should think that just as your program waited for the resource you were holding, you will end up waiting when your program is holding it.... |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
Why do you want to do this?
Maybe someone can offer an alternative method to achieve your requirement. |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
The job normally waits for the resource, and executes the program when the resource is freed.
But the program normally would not hold if the same resource is used by some thing else...
So I want to create a scnario where the resource should be free when the job is about to execute the program, but as soon as the program starts, the corresponding resource should be allocated to something else..
E.G "A" is the resource. I have a JCL which executes Program XYZ.
When the job is submitted, "A" should be free. But as soon as the control goes into the program, "A" should be used by some other resource (like I will keep the file open ).
I want to introduce a delay in the program (which would be used only during my testing), so that before resource "A" is used, I have enough time to think and use the same in some way.... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Do an ACCEPT from the console, that will take care of everything.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But the program normally would not hold if the same resource is used by some thing else...
|
YES, it would. Two users/processes should NOT use the same qsam file (see below).
If you want time to think before the program runs, think and then run the program.
Quote: |
When the job is submitted, "A" should be free. But as soon as the control goes into the program, "A" should be used by some other resource (like I will keep the file open ). |
This is the same question you posted recently in a different topic thread. The answer is still the same - one user at a time on the qsam file - especially when it is going to be output which is what you posted previously. |
|
Back to top |
|
|
|