How to check free and allocated space for different base and delta library types?
Release : ALL
Component : ENDBAS
1) For PDS and PDSE
You can simply use ISPF option 3.4 and do the "I" line command against the data set. But, this can be inconvenient when this needs to be done for a large number of data sets. However, the REXX command LISTDSI provides the same functionality.
The LISTDSI command is documented here.
Sample:
//ALOCINFO JOB
//*******************************************************************
//* Show space allocation and usage for Endevor base/delta PDS/PDSE.
//*******************************************************************
//* Create a REXX member in a temp data set
//*******************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DATA,DLM=$$
/* REXX */
ARG DSN
RC = LISTDSI("'"DSN"' DIRECTORY")
SAY '***************************************************************'
SAY ' Return Code: ' RC
SAY ' Data Set Name: ' SYSDSNAME
SAY ' Data Set Type: ' SYSDSSMS
SAY ' Space Units: ' SYSUNITS
SAY ' Space Allocated: ' SYSALLOC
SAY ' Space Used (PDS Only): ' SYSUSED
SAY ' Space Primary: ' SYSPRIMARY
SAY ' Space Secondary: ' SYSSECONDS
SAY ' Extents Allocated: ' SYSEXTENTS
SAY ' Extents Used (PDS Only): ' SYSUSEDEXTENTS
SAY ' Number of Members: ' SYSMEMBERS
SAY
SAY '**** PDS Only Section'
SAY '**** 1 directory block can accommodate exactly'
SAY '**** 4 footprinted base/delta members.'
SAY
SAY ' Directory Blocks Allocated: ' SYSADIRBLK
SAY ' Directory Blocks Used: ' SYSUDIRBLK
SAY
SAY '**** PDSE Only Section'
SAY '**** For 3390 units, 1 CYL = 180 pages'
SAY '**** and 1 TRK = 12 pages. 1 page = 4 KiB.'
SAY '**** Always, regardless of data set attributes.'
SAY
SAY ' PDSE Version (1/2): ' SYSDSVERSION
SAY ' Pages Allocated: ' SYSALLOCPAGES
SAY ' Pages Used: ' SYSUSEDPAGES
SAY ' Pages Used (Percentage): ' SYSUSEDPERCENT
SAY
$$
//SYSUT2 DD DSN=&&SYSPROC(ALOCINFO),
// DISP=(NEW,PASS),SPACE=(CYL,(1,1,1)),
// RECFM=FB,LRECL=80,BLKSIZE=0
//*******************************************************************
//* Execute the REXX member in batch with TSO services available
//*******************************************************************
//STEP2 EXEC PGM=IKJEFT01
//SYSPROC DD DISP=(OLD,DELETE),DSN=&&SYSPROC
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ALOCINFO Prefix.ENDEVOR.$
ALOCINFO Prefix.ENDEVOR.$$
ALOCINFO Prefix.ENDEVOR.LL
ALOCINFO Prefix.ENDEVOR.LL.PDSE
2) For ELIBs
Run the BC1PNLIB function INQUIRE, without OPTIONS is sufficient.
The BC1PNLIB utility is documented here.
The output looks like this, Highlighted the important parts as follows:
Sample:
DDNAME: ELIB1
DSNAME: Prefix.ENDEVOR.STG1.BASE.VSAM
LIBRARY TYPE: VLB
PAGE SIZE: 4088
LAST PAGE: 180
FILE PAGE SIZE: 4088
INITIALIZED: mm/dd/yyyy hh:mm:ss
(RE)ALLOC STAMP: 0
LAST REORG/EXPAND: mm/dd/yyyy hh:mm:ss
FILE SIZE (PAGES) 180
FIRST ALLOCATION: 180
EXPAND ALLOCATION: 180
RESERVE LIMIT: 20
BIT MAP PAGES: 1 STARTING AT 2
DIRECTORY TARGET PAGES: 8 STARTING AT 3
ALLOC MAP BYTES: 27
PAGES USED: 13
PAGES FREE: 167
LAST UPDATE STAMP: 1
LAST UPDATE: mm/dd/yyyy hh:mm:ss
LATEST MEMBER: xxxxxxxx
AVG PAGES/MEMBER: 3
# DATA PAGES: 3
# REPLACES: 0
# ADDS: 1
# DELETES: 0
# MEMBERS: 1
# DIRECTORY PAGES: 8
# DIR OVERFLOWS: 0
LONGEST DIR OVFL: 0
# LIBRARY EXTENDS: 0
# DIRECTORY REORG: 0
3) For a USS path
You can display the free/used/total space of the mount point in 1 KB units with the df command.
The df command is documented here.
Sample:
$ df -kP /xxxx/u/users/nfs/xxxxxxxx/zfs
Filesystem 1024-blocks Used Available Capacity Mounted on
xxxxxxxx.ZFS 4194000 562153 3631847 14% /xxxx/u/users/nfs/xxxxxxxx/zfs