View previous topic :: View next topic
|
Author |
Message |
jrosiak
New User
Joined: 24 Jul 2023 Posts: 3 Location: Poland
|
|
|
|
Hi!
My question is rather straightforward. I've been researching for some time on how to programmatically retrieve dataset allocation parameters using Java or C/C++. I found several solutions (e.g. using JZOS to read DSCBs or fldata() function for C), however, all of the ones I came across are lacking in terms of information regarding primary and secondary extent size which is something of great importance for my use case.
Information that I would like to retrieve could be similar to what LISTDSI() function in REXX provides. It is somehow able to retrieve SYSPRIMARY and SYSSECONDS parameters which store values corresponding to primary and secondary extent size. I wasn't able to reverse engineer this behavior, and I can't seem to find a method on how to access that information.
I would appreciate any suggestions on how to retrieve this info about datasets |
|
Back to top |
|
|
jrosiak
New User
Joined: 24 Jul 2023 Posts: 3 Location: Poland
|
|
|
|
sergeyken wrote: |
Try this Interface DSCB
Or start from here: Class ZFile
I did not try it by myself; always making every task in the most simple way. |
Thank you for your input! Unfortunately it appears that the links are not functional |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2146 Location: USA
|
|
|
|
Try this Interface DSCB
Or start from here: Class ZFile
I did not try it by myself; always making every task in the most simple way. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2595 Location: Silicon Valley
|
|
|
|
All of the information is in the format 1 DSCB:
1. size of primary extent
2. size of secondary extents
3. whether extents are cyls or tracks
4. number of secondary extents allocated.
To get the size of the secondary= size_of x number_of
The field descriptions are in the System Debugging Handbooks, but IIRC, either they were never converted to PDF or you have to pay extra for them.
Otherwise, you have to look in 'SYS1.MODGEN(IECSDSL1)', as Interface DSCB says. And that macro might do an include of other macros. |
|
Back to top |
|
|
jrosiak
New User
Joined: 24 Jul 2023 Posts: 3 Location: Poland
|
|
|
|
Pedro wrote: |
All of the information is in the format 1 DSCB:
1. size of primary extent
2. size of secondary extents
3. whether extents are cyls or tracks
4. number of secondary extents allocated.
To get the size of the secondary= size_of x number_of
The field descriptions are in the System Debugging Handbooks, but IIRC, either they were never converted to PDF or you have to pay extra for them.
Otherwise, you have to look in 'SYS1.MODGEN(IECSDSL1)', as Interface DSCB says. And that macro might do an include of other macros. |
Pedro, thank you very much for that insight. I might have gotten too overwhelmed with trying to grasp what format 1 DSCB represents. I would like to clarify one thing though.
In your comment, what stands for "size_of" and "number_of"?
"To get the size of the secondary= size_of x number_of" |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2595 Location: Silicon Valley
|
|
|
|
Sorry, I misunderstood your post. I think you are just after the size of the primary and the size of secondary. So you just have to be able to parse out the specific fields from the DSCB.
===
What I originally stated was to get the actual size of a PDS. It is a complex subject (there are probably books written about this). You have to add the primary and all of the secondary extents (up to 16 secondary extents).
If it is a PDSE, then I believe you have to check the catalog for VSAM information to get pages allocated and pages used. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 592 Location: London
|
|
|
|
It's not specified what type of datasets the information is being retrieved for or for what use, but the type and format of a dataset makes a really big difference to its potential maximum size. I'm not sure if DSNTYPE is in the FMT1 DSCB but it probably is.
It also matters what potential number of volumes could be allocated and that is driven by either DATACLAS, volume count or unit number. Maximum number of volumes is 59 for DASD datasets.
Basic QSAM - 1 Primary and up to 15 Secondary extents per volume. Maximum size per volume is 65k tracks.
Large format QSAM - 1 Primary and up to 15 Secondary extents per volume. Maximum size per volume ~16m tracks.
Extended Format QSAM - 1 Primary and up to 122 Secondary extents per volume. No limit on size per volume.
Standard VSAM - 1 Primary and up to 122 Secondary extents per volume. No limit on size per volume. Total maximum size 4GB
Extended Format VSAM - 1 Primary and up to 122 Secondary extents per volume. No limit on size per volume. Total maximum size 4GB
Extended Format and Extended Addressability VSAM - 1 Primary and up to 122 Secondary extents per volume. No limit on size per volume. Total maximum size can be larger than 4GB
PDS - 1 Primary and up to 15 Secondary extents per volume. Cannot be multi-volume. Maximum size per volume is 65k tracks.
PDSE- 1 Primary and up to 122 Secondary extents per volume. Cannot be multi-volume. No limit on size per volume. |
|
Back to top |
|
|
|