View previous topic :: View next topic
|
Author |
Message |
Biswajit D
New User
Joined: 17 Apr 2012 Posts: 50 Location: India
|
|
|
|
I was trying to compute the % free space for a PDS.. below is what i used..
Code: |
USEDSPACE=0
FREESPACE=0
IF DATATYPE(SYSUSED) = "NUM" & DATATYPE(SYSEXTENTS)="NUM",
& DATATYPE(SYSSECONDS)="NUM" THEN DO
TOTSPACE=(SYSUSED + ((17-SYSEXTENTS) * SYSSECONDS))
IF TOTSPACE \= 0 THEN DO
USEDSPACE=SYSUSED/TOTSPACE * 100
FREESPACE=100 - USEDSPACE
END
END |
it gave me percentage free for a PDS as 96.97%(below is output of my rexx)
Code: |
XXXXXX.XXXXXX.XXX 2012/192 2010/291 96.969697 LIBS |
below is what 3.4 says
Code: |
Command - Enter "/" to select action Tracks %Used XT
-------------------------------------------------------------------------------
XXXXXX.XXXXXX.XXXXX 15 66 1 |
below are the LISTDSI variables for the PDS:
Code: |
SYSDSORG = PO
SYSRECFM = VB
SYSLRECL = 255
SYSBLKSIZE = 27998
SYSALLOC = 1
SYSUSED = 1
SYSUSEDPAGES =
SYSPRIMARY = 1
SYSSECONDS = 2
SYSUNITS = CYLINDER
SYSEXTENTS = 1
SYSTRKSCYL = 15
SYSBLKSTRK = 2
SYSADIRBLK =
SYSUDIRBLK =
SYSMEMBERS = |
dataset property:
Code: |
Data Set Name . . . . : XXXXXX.XXXXXX.XXXXX
General Data Current Allocation
Management class . . : NEVERMIG Allocated cylinders : 1
Storage class . . . : STANDARD Allocated extents . : 1
Volume serial . . . : TMD013 Maximum dir. blocks : 135
Device type . . . . : 3390
Data class . . . . . : DLTDATA
Organization . . . : PO Current Utilization
Record format . . . : VB Used cylinders . . : 1
Record length . . . : 255 Used extents . . . : 1
Block size . . . . : 27998 Used dir. blocks . : 2
1st extent cylinders: 1 Number of members . : 10
Secondary cylinders : 2
Data set name type : PDS Dates
Creation date . . . : 2010/10/18
Referenced date . . : 2012/07/10
Expiration date . . : ***None***
F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap |
what i am calculating is vastly different from what ISPF says...
is my formula correct??
if formula is correct, am i using the correct variables for calculation?? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
since it is a pds,
why don't you attempt to COMPRESS the PDS
and then see what the 3.4 says? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Quote: |
TOTSPACE=(SYSUSED + ((17-SYSEXTENTS) * SYSSECONDS)) |
How did you come up with that?
The figure you are comparing your output to is in tracks. Yours is in Cylinders. You will have 1 used of 1 Cylinder, against the partial use of a Cylinder in tracks.
EDIT: If you get anywhere. remember to test with things like: primary allocation satisfied by multiple extents; secondary allocation satisfied by multiple extents; multi-volume (primary on each volume); if dealing with fancy new datasets you'll need to deal with more than 16 extents; etc... |
|
Back to top |
|
|
Biswajit D
New User
Joined: 17 Apr 2012 Posts: 50 Location: India
|
|
|
|
looks like its gonna be a scratch my brain day tomorrow... will keep you posted if and when i get somewhere... |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
Firstly PDS (and PDSE's) cannot be multi-volume and cannot be larger than 65k tracks.
All you need to do is first check SYSUNITS, if it is CYL then first multiply SYSALLOC and SYSUSED by 15 to arrive at the number of tracks allocated or used. Multiply the number of tracks by 56664 (track capacity) and you will have the total bytes allocated or used. Divide used bytes by allocated bytes and * 100 to arrive at percent used.
Not sure if there are any variables to indicate how many directory blocks there are and how many are used (PDS only), but that is another constraint.
Equally, PDS's are limited to 16 extents and PDSE's limited to 123 extents so if they're approaching those limits it's just as important as total used space. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
Forgot to mention, talk to your Storage team, there's likely some OEM reporting tool at your site that will do all this for you!
Even ISMF option 1 will give you allocated and used figures in KB. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Pete Wilson wrote: |
Even ISMF option 1 will give you allocated and used figures in KB. |
Yes, this had been a choice since some time now unless someone forces to use some fancy REXX Tools... |
|
Back to top |
|
|
Biswajit D
New User
Joined: 17 Apr 2012 Posts: 50 Location: India
|
|
|
|
Thank You Pete. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello Pete,
Quote: |
All you need to do is first check SYSUNITS, if it is CYL then first multiply SYSALLOC and SYSUSED by 15 to arrive at the number of tracks allocated or used. Multiply the number of tracks by 56664 (track capacity) and you will have the total bytes allocated or used. Divide used bytes by allocated bytes and * 100 to arrive at percent used. |
I think the suggestion makes sense theoretically but has some limitations when it is used with LISTDSI. In the above case
Code: |
SYSALLOC = 1
SYSUSED = 1
SYSUNITS = CYLINDER |
So theoretically the utilization was 100%.
and the actual utilization was
Code: |
Command - Enter "/" to select action Tracks %Used XT
-------------------------------------------------------------------------------
XXXXXX.XXXXXX.XXXXX 15 66 1 |
The reason I am being picky is because I too have written a small space calculation REXX(3 years back), but found out the hard way that not all the values calculated by the program were correct.
So I think accounting by KB by ISMF or DCOLLECT is the right way to go.
I am open to corrections and hope I am not being captain obvious, I still want my potato.
Regards, |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
You're right of course Vasanthz. It really depends how finely you need to drill down on this information. It is more relevent with smaller files as in your example.
As I can't code rexx even if my life depended on it I tend to use OEM's like FDREPORT which gives a nicely formatted report with everything you need
e.g.
//FDR#PDS EXEC PGM=FDREPORT
//SYSPRINT DD SYSOUT=*
//ABRMAP DD SYSOUT=*
//ABRSUM DD SYSOUT=*
//SYSIN DD *
REPORT FIELD=(NAME,SIZE,SIZEUSED,%FREE,DIRBLOCK,%DIRFREE,
NOEXTENT,DSORG,MEMBERS)
XS XDSN=DSNAME.MASK1.**,
DSORG.EQ.(PO),
%FREE.LE.10
XS XDSN=DSNAME.MASK1.**,
DSORG.EQ.(PO),
%DIRFREE.LE.10
XS XDSN=DSNAME.MASK1.**,
DSORG.EQ.(PO),
NOEXTENT.GT.12
SORT FIELD=(NAME)
PRINT DATATYPE=CATVTOC,RPTYPE=TABLE,SUM=NO,SORT=CO,
ENABLE=(FASTPATH)
gives a report like this.....
ENTRY NAME ALLOC USED %FR DIRBK %DF EXT DSO
DSNAME.TWO.PDS 23 23 0 50 96 4 PO
DSNAME.THREE.PDSE 425 421 1 114 0 17 POE
/* |
|
Back to top |
|
|
|