In my JCL I am using two DD names but same physical file. e.g. -
//DDNAME1 DD DSN=FILE.TEST,DISP=SHR
//DDNAME2 DD DSN=FILE.TEST,DISP=SHR
My Program opens both the DDNAMES in IO mode.
When i create the file (FILE.TEST) as IAM file then my code works fine but when the file is created as a VSAM file then it gives an Open Error code 168 for the DDNAME2.
Ques is - Why is the code working fine for IAM and not for VSAM files?
IAM Documentation says that a Single IAM cannot be accessed simultaneously if used in OUTPUT mode in multiple programs. I even tried it by submitting two different Jobs opening the same file in OUTPUT mode. One of the Job went on HOLD due to DATASET contention.
Still Not sure how the file can be opened in OUTPUT mode if the same Job and Same program is opening it as in my example below. Seems to be a IAM bug to me [/quote]