This may get truncated on the list because I think the list software
truncates emails after two adjacent minus signs.
-- Replace all occurances of QAEZD0053 with QAEZDwhatever
-- Replace all occurances of ROUTINES with the library specified in
RTVDIRINF.
-- You can read the help on RTVDIRINF on more information about the QAEZD*
files.
-- List QAEZD* files
select system_table_schema as Library, system_table_name as file
from qsys2.systables
where system_table_schema='ROUTINES' and system_table_name like 'QAEZD%'
order by system_table_name desc;
-- List of objects by biggest directory
With t1 as(
select distinct d.qezdirnam1 as ParentDirectory,
qezdiridx
from routines.QAEZD0053d d
where locate('/',d.qezdirnam1,2)=0
and d.qezdirnam1<>'/'
),
T2 as (
Select ParentDirectory, qezdirnam1,o.qezdtasize as size
from T1, routines.qaezd0053d d left outer join
routines.qaezd0053o o on d.qezdiridx=o.qezdiridx
where qezdirnam1 like trim(ParentDirectory) concat '%'
and (qezdirnam1 = ParentDirectory or
substr(qezdirnam1,1,max(locate('/',qezdirnam1,2)-1,1)) =
ParentDirectory)
)
select ParentDirectory, sum(size) as dirsize
From T2
Group by ParentDirectory
order by 2 desc
;
-- Biggest items on the system, stream files or "traditional"
-- Combined QAEZDISK with QAEZD... to sum up tables with multiple members.
With T1 as (
Select
diobsz as size,
diobli as DirectoryName,
diobnm as ObjectName
From qusrsys.qaezdisk
where diobli <> ' '
UNION ALL
Select o.qezdtasize as size, qezdirnam1 as DirectoryName, qezobjnam as
ObjectName
from routines.qaezd0053d d left outer join
routines.qaezd0053o o on d.qezdiridx=o.qezdiridx
where qezdirnam1 not like '/QSYS.LIB%')
Select size, DirectoryName, ObjectName
From T1
Order by size desc
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.