Showing posts with label Java on Z/OS. Show all posts
Showing posts with label Java on Z/OS. Show all posts

Tuesday, December 4, 2012

VOL(serial_number) not working as expected

When you give VOL(serial_number) through java on Zos, make sure that the respective dataset has CATALOG defined.

The reason being is when we say CATALOG, it means, it will create an indexed version of created dataset, so that it can fetch back using the index. Otherwise, while searching for the dataset, we have to pass VOL(serial_number).

Wednesday, October 10, 2012

Why newly created dataset properties are overriden?

I created a dataset using ZFile.bpxwdyn() method. I copied some content form other dataset to it using
 new ZFile(ZFile.getSlashSlashQuotedDSN(inputDatasetName, true).

But ZFile constructor has overriden some of the properties of "inputDatasetName".

Root cause:

I missed to pass attributes along with ZFile constructor as shown below(highlighted in blue color):

new ZFile(ZFile.getSlashSlashQuotedDSN(inputDatasetName, true),"rb,type=record,recfm=fb,lrecl=80,noseek");

Analysis:
That means ZFile constructor will have some defualt values assigned to it. So if we don't pass any it will take default.