Using SQL to check for level check, reuse deleted, and file size

There are three things about data physical files I always like to keep track of:

Level check statusWill file reuse deleted recordsWhat is the maximum number of records the file can contain

For years I have used the Display File Description command, DSPFD, to create a lists of the files in a library, or libraries, and then read that file to check the fields for that information. As I can execute CL commands in ACS’s Run SQL Scripts I can do the following:

01 CL:DSPFD FILE(MYLIB/*ALL) TYPE(*ATR) OUTPUT(*OUTFILE)
FILEATR(*PF) OUTFILE(QTEMP/DSPFD_ATR) ;

02 SELECT PHLIB,PHFILE,PHDTAT,PHLVLC,PHRCDC,PHRUSE
FROM QTEMP/DSPFD_ATR ;
Read more »

Verified by MonsterInsights