Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
mrgnndhmk

New User

Joined: 01 Feb 2006
Posts: 50
Location: India

Posted: Sat Apr 22, 2017 12:42 am    Post subject: VSAM Space Allocation

Hi All,
I searched in the forum for my answers but I did not quite get it. Therefore, posting the questions.

1. In LISTCAT, I have the following scenarios
 Code: 1. HI-A-RBA = HI-U-RBA  and FREESPC > 0 2. HI-A-RBA <> HI-U-RBA and FREESPC <> (HI-A-RBA - HI-U-RBA) 3. HI-A-RBA <> HI-U-RBA and FREESPC = (HI-A-RBA - HI-U-RBA))

On what basis FREESPC could be different from HI-A-RBA - HI-U-RBA?

Should I take the RBA from Allocation section or the Volume section?

Ultimately I want one single method to compute the Free Space/Used Space for the VSAM Files.

I have given example for each of the above scenario

Scenario 1 (Data) & 3 (Index):

Scenario 2 (Data) & 3 (Index):

Rohit Umarjikar

Senior Member

Joined: 21 Sep 2010
Posts: 2346
Location: NY,USA

 Posted: Sat Apr 22, 2017 12:54 am    Post subject: Please see if you learn anything from here. VSAM Demystified
Robert Sample

Global Moderator

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

Posted: Sat Apr 22, 2017 7:31 am    Post subject:

First, remember that there is CI freespace and CA freespace. If you specify CI freespace of 20%, that means 20% of each CI is left without any data. If the CI size is 4096 that means about (the VSAM Demystified manual will give you the exact calculation) 820 bytes of each CI is free; if the HI-A-RBA and HI-U-RBA are the same, there is STILL 20% freespace in each CI (unless of course splits occurred).

Second, freespace may be used for records as inserts are done, so freespace may be less than HI-A-RBA minus HI-U-RBA.

Third, freespace in the CI may cause the freespace to be more than HI-A-RBA minus HI-U-RBA.

 Quote: Should I take the RBA from Allocation section or the Volume section?
If you use the Volume section, you will need to find the highest single RBA value (there are a low and high RBA for EACH extent on the volume - if there are more than one volume, you will need to find the highest RBA on ALL volumes). If you compare the Allocation and Volume sections for the LISTCAT output you posted, you will see the HI-A-RBA matches the largest Volume RBA (as long as you add 1 to the Volume RBA). So it doesn't matter which you take as long as you pick the largest Volume RBA.
 Quote: Ultimately I want one single method to compute the Free Space/Used Space for the VSAM Files.
Subtract free space from HI-A-RBA to give Used space (ignore HI-U-RBA). Divide free space by used space. Two simple calculations, one method. Now the question is, what are you going to do with this number? It has little, if any, practical value. Free space needs to be driven by the application; some applications don't need free space while other applications should have substantial CI free space but little CA free space or vice versa and other applications need substantial CI and CA free space.
mrgnndhmk

New User

Joined: 01 Feb 2006
Posts: 50
Location: India

 Posted: Tue May 02, 2017 6:44 pm    Post subject: Thanks Robert - you made the explanation easier. After reading yours, VSAM Demystified looks demystified. The reason I come to this forum is, to me you guys are better than the books in simplifying the explanations Coming to the question on the calculation - This calculation helps me to identify files which can cause failures potentially based on how it is growing and how it is used. We have around 1000+ files (KSDS & ESDS) and since our Mainframe is quite stable, we identified only 50+ files which need the redefinition. More questions 1. Will LISTCAT produce correct result on a file irrespective of whether that file is used by a Job or CICS at the time of issuing LISTCAT? 2. Records Retrieved for Index Component - A file read on DATA internally uses index to retrieve the record. Would this not update the Records Retrieved for Index Component? ~Muru
Robert Sample

Global Moderator

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

Posted: Tue May 02, 2017 8:16 pm    Post subject:

 Quote: 1. Will LISTCAT produce correct result on a file irrespective of whether that file is used by a Job or CICS at the time of issuing LISTCAT?
No -- if the LISTCAT output has asterisks beside the fields, then they are not accurate and may be changed when the task using the VSAM data set closes it.
 Code: STATISTICS  (* - VALUE MAY BE INCORRECT)                                                         REC-TOTAL------------844*    SPLITS-CI-------------22*    EXCPS---------------6378*             REC-DELETED----------620*    SPLITS-CA--------------1*    EXTENTS----------------1             REC-INSERTED--------1386*    FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:                     REC-UPDATED---------1679*    FREESPACE-%CA----------0          X'D27517B1DBF7CD0A'             REC-RETRIEVED------59115*    FREESPC----------2686976*
 Quote: 2. Records Retrieved for Index Component - A file read on DATA internally uses index to retrieve the record. Would this not update the Records Retrieved for Index Component?
I suspect not in the way you think. Records in the index component are pointers to Data CI, and there may multiple levels of index (depending upon the VSAM data set). I've never looked at the records retrieved for the index component that closely, so I'm not sure if it updates once per data record or once per index CI retrieved.
Robert Sample

Global Moderator

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

Posted: Wed May 03, 2017 12:21 am    Post subject: Reply to: VSAM Space Allocation

 Quote: 2. Records Retrieved for Index Component - A file read on DATA internally uses index to retrieve the record. Would this not update the Records Retrieved for Index Component?
I had a chance to test this. I created a 2-cylinder VSAM data set with 1000-byte records (1440 of them to be precise) and LISTCAT says I have an index with 3 levels. I then wrote a COBOL program to directly read 1000 records (from 441 to 1440) and then did a LISTCAT. The DATA component showed 1000 REC-RETRIEVED, as expected. The INDEX component showed 0 REC-RETRIEVED. I then changed the program to sequentially read 1000 records. Again, LISTCAT showed the expected 2000 REC-RETRIEVED for the DATA component (1000 direct reads and 1000 sequential reads) and the INDEX component showed 0 REC-RETRIEVED. I'll have to think about INDEX component REC-RETRIEVED and what it means some more.

But the answer to your question is now a definitive no, INDEX component REC-RETRIEVED is not related to the DATA component records retrieved.
mrgnndhmk

New User

Joined: 01 Feb 2006
Posts: 50
Location: India

Posted: Wed May 03, 2017 12:50 am    Post subject:

Thanks Robert.

 Quote: Edited: My understanding is that INDEX is inserted, updated & deleted but never read. It is only the Data that is read and Index is always used internally

I also confirmed that "REC-RETRIEVED" is always 0 for the INDEX Component.

Did you notice that it is not true for REC-DELETED, REC-INSERTED, REC-UPDATED?

I LISTCAT on a file with Index - It shows asterix for the record count parameters which means it may not be true?

 Code: 0   INDEX ------ PMT.METEST.INDEX       IN-CAT --- UCAT.ORDER.PROD       HISTORY         DATASET-OWNER-----(NULL)     CREATION--------2014.279         RELEASE----------------2     EXPIRATION------0000.000       PROTECTION-PSWD-----(NULL)     RACF----------------(NO)       ASSOCIATIONS         CLUSTER--PMT.METEST.KSDS       ATTRIBUTES         KEYLEN----------------14     AVGLRECL---------------0     BUFSPACE---------------0     CISIZE--------------1024 1IDCAMS  SYSTEM SERVICES                                           TIME: 14:37:40        04/21/17     PAGE    950 0       RKP--------------------0     MAXLRECL------------1017     EXCPEXIT----------(NULL)     CI/CA-----------------33         SHROPTNS(2,3)   RECOVERY     UNIQUE           NOERASE     NOWRITECHK     UNORDERED     NOREUSE       STATISTICS  (* - VALUE MAY BE INCORRECT)         REC-TOTAL------------117*    SPLITS-CI------------361*    EXCPS------------2528925*    INDEX:         REC-DELETED----------403*    SPLITS-CA--------------1*    EXTENTS----------------4     LEVELS-----------------3         REC-INSERTED---------290*    FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:            ENTRIES/SECT----------10         REC-UPDATED------1416594*    FREESPACE-%CA----------0          X'D26B7462804FAB42' SEQ-SET-RBA----------------0         REC-RETRIEVED----------0*    FREESPC-----------131072*                             HI-LEVEL-RBA----------100352       ALLOCATION         SPACE-TYPE---------TRACK     HI-A-RBA----------135168         SPACE-PRI--------------1     HI-U-RBA----------119808         SPACE-SEC--------------1
[/quote]
Robert Sample

Global Moderator

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

Posted: Wed May 03, 2017 1:08 am    Post subject:

I did a test with inserting some records into the VSAM KSDS and the REC-UPDATED for the INDEX component was non-zero after the inserts were done.
 Quote: It shows asterix for the record count parameters which means it may not be true?
I refer you to this line of the LISTCAT output:
 Code: STATISTICS  (* - VALUE MAY BE INCORRECT)
I've told you the values you get in the LISTCAT may not be correct, LISTCAT tells you that the values you see may not be correct, and now you're asking again -- how many times are you going to ask for confirmation of what you are being told? When you see "VALUE MAY BE INCORRECT" you can believe what you are being told. The values may be correct but since there is an active update underway the values you see could change at any moment.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Modify the shareoptions of VSAM in De... chavinash2004 CLIST & REXX 27 Wed Feb 26, 2020 6:28 pm Eliminating blank space in XML parsed... elixir1986 COBOL Programming 0 Tue Feb 11, 2020 4:41 am Rexx to create VSAM define statements Dinesh Mani CLIST & REXX 10 Fri Nov 29, 2019 9:26 pm REXX VSAM Harold Barnes CLIST & REXX 3 Sat Oct 05, 2019 2:38 pm CICS VSAM file max volumes socker_dad JCL & VSAM 4 Tue Aug 20, 2019 1:28 am

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us