View previous topic :: View next topic |
Author |
Message |
cobcurious Beginner

Joined: 04 Oct 2003 Posts: 68 Topics: 25
|
Posted: Sun Nov 27, 2005 7:02 pm Post subject: Sharing externaL files |
|
|
Hi,
I have multiple programs in that try to share the data using a common external file.I have a doubt regarding the sharing of the external file.The mulitple programs open the file,update it and close it but the time at which they may update the file is not fixed since the time of execution of the programs is not fixed.The order depends upon the count of records processed by each.I want to ask that if one of the program has opened the file,can we check if the file is already open ,using FILE-STATUS variable, in case some other program tries to open the same file ?
Thanks
Cobcurious |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sun Nov 27, 2005 8:04 pm Post subject: |
|
|
cobcurious,
Simply code DISP=OLD for the file in question and all other jobs will wait until the first job which opens the file first completes. The 2nd job will open the file and all other jobs will wait until the job completes and the cycle repeats for all the jobs
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
cobcurious Beginner

Joined: 04 Oct 2003 Posts: 68 Topics: 25
|
Posted: Sun Nov 27, 2005 8:35 pm Post subject: |
|
|
Thanks Kolusu,
I am running my job on Unix environment so JCL will not come in picture.So can you please suggest any solution for Unix environment ? Can FILE STATUS be handy in deciding if the file is already opened or closed by some other program ?
thanks again
Cobcurious |
|
Back to top |
|
 |
|
|