View previous topic :: View next topic
|
Author |
Message |
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
Hi all
I have a doubt in file open..my pgm has a normal input (flat file) and i'm opening tht file in my cobol pgm.i'm handling the error for file open problem also after file opening.But my code is not abending if i try to submit the job after opening the file in edit mode.And also i have given a TIME parameter in my JCL...my job is not abending..but once i come out of the file in edit mode..it is executing fine. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
That's because you have the file in EDIT mode, i.e. DISP=OLD which stops the batch job from allocating the file until you release it by coming out of edit mode. |
|
Back to top |
|
|
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
Thnx 4 the reply...i tried using DISP=SHR also...and In the Cobol pgm i'm opening in extend mode...but still it is not throwing a n error...and also i wud like to know why the pgm is not abending..since i ahve given a TIME parameter...in the jobcard... |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
What do you want here, successful execution or abend?
As per my view, you want an abend to happen here..?
When the resource is not available, your program is not getting control, it will be in wait state. when you release it it will be through.
TIME param will control execution time. if execution time of program exceeds the TIME parameter then program will abend.
Please see that execution time is different from waiting time.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
DISP=SHR on the job means nothing. You have the file held in EDIT which uses DISP=OLD. It only takes one DISP=OLD to stop ANY OTHER DISP from gaining access.
The time parameter as pointed out by agkshirsagar is for the execution time, and if you job is not executing because of dataset contention, it isn't going to use any time, so will not abend. |
|
Back to top |
|
|
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
Yea...i can understand ur point ...but i want the pgm to abend here...my question is why the pgm is not abending if i open the file in edit mode & try to submit the job? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Because the DISP=OLD used by your online session does not permit the batch job to access the file. It can not access the file until your online session has released the file, and when that happens there is no longer any file contention, so your job reads the file, or whatever.
This is a restriction imposed by the operating system. Perhaps you should try running two batch jobs both using DISP=SHR and see what happens. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Hopefully, this is just an experiment. . . .
If a file might be opened in edit, there should be no batch jobs submitted that would access the dataset. While the operating system will not let the batch job continue, the job will tie up machine resources needlessly. Depenging on the wait time-out set at your location, the job will eventually abend (time our) or be canceled by the operators.
Neither is a proper way to process. |
|
Back to top |
|
|
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
Thnx everyone for all ur explanations...got some idea on this topic.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
Something i neglected to mention previously - the TIME= parameter is for cpu time, not device wait time. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I suppose it would have 522'd eventually - depending on the site definitions for idle timeout. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Unless the "edit" session timed out first. . . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
I suppose it would have 522'd eventually - depending on the site definitions for idle timeout. |
Aaaaaaaaaaaaaah, my open reply did not specify which would time out first, the job or the TSO session. Covered all eventualities with only one reply |
|
Back to top |
|
|
nevilh
Active User
Joined: 01 Sep 2006 Posts: 262
|
|
|
|
Just for information if you edit a dataset in ISPF , ISPF will allocate the dataset with DISP=SHR |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
nevilh
Quote: |
Just for information if you edit a dataset in ISPF , ISPF will allocate the dataset with DISP=SHR |
I sort of remember this from a previous thread we had together, but somehow recall this was for a PDS rather than a PS.
Any clarification welcome. |
|
Back to top |
|
|
nevilh
Active User
Joined: 01 Sep 2006 Posts: 262
|
|
|
|
Clarification not required you are right ..... I should read the posts more carefully |
|
Back to top |
|
|
girias
New User
Joined: 09 Feb 2007 Posts: 26 Location: Chennai
|
|
|
|
Hi, how can we set the device wait time limit for a job? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Unless you are a systems programmer, you can not. |
|
Back to top |
|
|
|