Page 1 of 1

Listing all dataset in a volume

PostPosted: Wed Jun 10, 2015 11:33 pm
by aubi
Hello,

Is there a way, how to list all datasets in a volume, including the uncataloged ones?

According to the documentation, it should be ZFile.readDSCBChain, but it works only with complete DS name like
ZFile.readDSCBChain("//'data.set.name'", "volume") -- then it returns Format1DSCB, everything is fine. But I would like to set something like
ZFile.readDSCBChain("*", "volume") to get all datasets on the given volume.

Obviously, I cannot use catalog to find it :-)

Thank you
aubi

Re: Listing all dataset in a volume

PostPosted: Thu Jun 11, 2015 1:00 am
by enrico-sorichetti
obviously You cannot have what You ask for ...

public class ZFile
extends java.lang.Object
implements ZFileConstants
JNI Wrapper for z/OS C-Library IO routines. An instance of ZFile is a thin wrapper around a C-library file handle and can be used to access MVS datasets using a dataset or DD name.
For more efficient z/OS sequential dataset record read and write, please refer to RecordReader and RecordWriter.

Java native methods in this class simply call their C-library equivalents. Please refer to the following IBM C/C++ publications, which describe how to open MVS datasets and DD names in both record and stream mode.


since there is no C-library function to list a VTOC , then You cannot have what You ask for

Re: Listing all dataset in a volume

PostPosted: Mon Jun 15, 2015 10:58 pm
by aubi
Thanks a lot, Enrico! You saved me time trying to find the way.

I did the task via our old product and I process its output.

Petr

Re: Listing all dataset in a volume

PostPosted: Mon Jun 15, 2015 11:14 pm
by aubi
...

Re: Listing all dataset in a volume

PostPosted: Mon Jun 15, 2015 11:26 pm
by enrico-sorichetti
see

http://www.redbooks.ibm.com/abstracts/s ... .html?Open

it could be a VERY interesting exercise to take the assembler example in appendix c of the above

and translate it to C... METAL C might be better ;)