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

LDS Dataset - Used Space


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jun 13, 2011 6:13 pm
Reply with quote

Hi,

Is there any way to find the used space for an LDS dataset.

In ISPF 3.4 option we can see the total allocated size but the utilitzation is shown as "?"

We currenly use FDREPORT to find the used space for the dataset. Is there any other way to do the same?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Jun 13, 2011 6:25 pm
Reply with quote

Wouldn't the utilization be 100% for a linear data set -- always?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jun 13, 2011 7:00 pm
Reply with quote

I am talking about the underlying dataset for the tablespace.

Suppose we allocate PRIQTY - 7200 and SECQTY - 7200.

And the table is loaded with only 100 records then I want to know the actual used space.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Jun 13, 2011 7:18 pm
Reply with quote

From the VSAM Demystified Redbook:
Quote:
1.6.5 Linear data set (LDS)
A linear data set (LDS) contains data that can be accessed as byte-addressable
strings in virtual storage. It is a VSAM data set with a control interval size multiple
of 4096 bytes. An LDS has no imbedded control information in its CI, that is, no
RDFs and CIDFs. All LDS bytes are data bytes. Logical records must be blocked
and deblocked by the application program. Logical records are transparent from
VSAM’s point of view.
as per the Redbook, your statement
Quote:
And the table is loaded with only 100 records then I want to know the actual used space.
is complete and utter rubbish. A VSAM LDS does not have records. If you think it does, I strongly recommend you go to the Redbook and read it cover to cover enough times that your thinking is changed.

Since the LDS is byte-addessed, if you allocated 7200 (presumably CI) to it, then the number of allocated (and used) bytes will be 7200 times the CI size. If you are storing data in the LDS, it is up to your application to keep track of which bytes are used and unused -- as far as the system is concerned, the LDS is 100% used when you've allocated it, as I said before.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 13, 2011 8:44 pm
Reply with quote

Hello,

When working with "db2 datasets" - use db2. . .

Directly working with db2 LDS datasets is a sure way to hurt yourself. IBM has no reason to publish changes as to the mechanics of how db2 uses the linear datasets. You could get an ugly surprise one day. . .

Suggest you ask your dba if what you want is not already available.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Jun 13, 2011 9:04 pm
Reply with quote

Hi Dick,

Currently we use FDREPORT to find the space utilization of DB2 dataset. I wanted to know is there any other way/utility to do that?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 13, 2011 9:24 pm
Reply with quote

Hello,

What does your dba say?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 13, 2011 9:24 pm
Reply with quote

as usual the terminology used is incorrect.
db2 does not have datasets.

now, if you were to spend some time with the db2 admin reference,
there are all kinds of sys.... (tables) that contain this information.

based on your db2 version,
either you have to reorg/runstats to keep them up-to-date
or the newer versions have 'run-time' / 'always current' runstats for things like space usage and allocation.
the information that you want is available thru db2 utilities
and querys against the sysibm-tables.

as dick scherrer mentioned,
deal with db2 via db2.

this is another example of 'a little knowledge is a dangerous thing'.
if you attempt to deal with db2 data thru the underlying lds,
not even ibm will help you if you screw it up.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Jun 14, 2011 4:18 pm
Reply with quote

gylbharat,

Currently the best available option is to query the catalogs SYSTABLESPACESTATS look for column SPACE, DATASIZE.

Thanks,
Sushanth
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
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 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