IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using Java/C/C++ to retrieve dataset extent size


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jrosiak

New User


Joined: 24 Jul 2023
Posts: 3
Location: Poland

PostPosted: Mon Jul 24, 2023 10:55 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
jrosiak

New User


Joined: 24 Jul 2023
Posts: 3
Location: Poland

PostPosted: Mon Jul 24, 2023 11:55 pm
Reply with quote

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 icon_cry.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Mon Jul 24, 2023 11:57 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jul 25, 2023 12:26 am
Reply with quote

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
View user's profile Send private message
jrosiak

New User


Joined: 24 Jul 2023
Posts: 3
Location: Poland

PostPosted: Tue Jul 25, 2023 1:38 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jul 25, 2023 4:25 am
Reply with quote

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
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 582
Location: London

PostPosted: Tue Jul 25, 2023 11:43 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top