Can VSAM KSDS shareoption to avoid VSAM open error 168



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby ocjohnh » Tue Aug 20, 2013 3:36 pm

Hi, When I have two batch jobs (with IDCAMS REPRO commands) run concurrently, either one will certainly get VSAM open error 168 --> "file opened by other ACB", which I admit it is normal. But with a little hope I wonder if any slight chance that I can have some fancy way to avoid such errors (e.g by using VSAM shareoptions !?)
ocjohnh
 
Posts: 12
Joined: Tue Jul 31, 2012 1:22 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby BillyBoyo » Tue Aug 20, 2013 4:04 pm

Are they source or target files, or a mixture?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby ocjohnh » Tue Aug 20, 2013 4:11 pm

Sorrry, i should have say it clearly
What i meant is the target file, and i prefer not to use disp as Old in JCL to around the problem
ocjohnh
 
Posts: 12
Joined: Tue Jul 31, 2012 1:22 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby Robert Sample » Tue Aug 20, 2013 5:11 pm

What are the current VSAM SHAREOPTIONS?

And to make sure we understand correctly, you have two jobs that you want to run simultaneously on a single LPAR that both need to write to the VSAM KSDS? Do the jobs write data to the entire file, to only some selected key ranges, or do you not have any idea?
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby BillyBoyo » Tue Aug 20, 2013 5:12 pm

Well, I think you could do it. However, I think the chance of your having meaningful or reproduceable results are nil.

What business requirement are you trying to satisfy? We may have some better suggestions than what you think is an answer for you.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby ocjohnh » Tue Aug 20, 2013 6:36 pm

Hi Robert, the shareoption(2,3) is being used for the output file. This situation is I have two jobs that I want to run simultaneously on a single LPAR that both need to add new records into to the VSAM KSDS . The command is simply "repro infile(??) outfile(??)".

Hi Billy, The requirement for me is that I have a KSDS which contains in-house data, and from time to time there will a number of TSO users to insert new records in the KSDS. Originally we think about asking users to use REPRO instead of any COBOL / Easytrieve pgm in order to minimize the development effort.
ocjohnh
 
Posts: 12
Joined: Tue Jul 31, 2012 1:22 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby Robert Sample » Tue Aug 20, 2013 6:50 pm

It is possible to change the SHAREOPTIONS to allow multiple programs to write to the output KSDS file at the same time. HOWEVER, you will NOT be able to use IDCAMS if you make such a change. You also need to consult your site support group since they may have site options set that would complicate the task. You will need to change the SHAREOPTIONS and implement programmatic ENQUEUE and DEQUEUE logic to lock the KSDS for adding records -- which may require writing a new program to perform this function. While it is possible to have two programs writing to the same KSDS at the same time, without using ENQUEUE / DEQUEUE logic you have a very high chance of corrupting the VSAM data set and making it completely unusable.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby ocjohnh » Tue Aug 20, 2013 6:57 pm

Thanks Robert....
ocjohnh
 
Posts: 12
Joined: Tue Jul 31, 2012 1:22 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Can VSAM KSDS shareoption to avoid VSAM open error 168

Postby mongan » Tue Aug 20, 2013 8:21 pm

And why not just have two input files for your repro and the one output, or sort the two files creating on output file that runs with repro against the ksds?
User avatar
mongan
 
Posts: 211
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post