Problem solve Get help with specific problems with your technologies, process and projects.

Find wasted space in files

Discover "wasted" space in files that may "reuse" deleted records.

Administrators are often engaged when space utilization is high. Well, here is a way to discover "wasted" space in files that may "reuse" deleted records. One word of caution, check with your developers to assure you may reuse deleted records.

Prior to running the SQL below, I used STRQMQRY to run in batch. You'll need to use the DSPFD (TYPE *MBRLIST) command to populate an output file containing all of the file description information on the files you are interested in.

The query selects and displays file information, when the percentage of deleted records is greater than 25% of the number of active records.

  
SELECT MLLIB,MLFILE,MLNAME,MLNRCD,MLNDTR,                         
MLNDTR+MLNRCD as "Tot Recs",                                      
decimal(round(MLNDTR/(MLNDTR+MLNRCD), 4), 5, 4)*100 AS "Pct Dltd",
decimal(round(MLSIZ2*(MLNDTR/(MLNDTR+MLNRCD)/1000), 0),15, 0)     
AS "K-Bytes Wasted",                                              
MLMTXT,MLSIZ2                                                     
FROM SYSLIB/PRDFILES WHERE MLNDTR > (.25 * MLNRCD)                
ORDER BY "K-Bytes Wasted" DESC   

This was last published in January 2005

Dig Deeper on iSeries hardware management

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close