Yes. And it is really easy. DSPOBJD to an outfile should be forgotten
for those on a supported version of the OS.

Start out at:
http://ibm.biz/DB2foriServices
Then you want to look at OBJECT_STATISTICS. As in:

SELECT
obj.objname, obj.objlib, obj.journaled, obj.journal_name,
obj.journal_library,
obj.*
FROM
TABLE(QSYS2.OBJECT_STATISTICS('*ALL','*PGM')) AS OBJ
WHERE OBJ.OBJNAME='ACD0010';

In the earlier days of OBJECT_STATISTICS, to get the *ALL to work you used
to have to LATERAL it like the following, in which one run was to get the
list of libraries and the other was to find the objects in that library:

SELECT
obj.objname, obj.objlib,obj.objlibrary, obj.journaled, obj.journal_name,
obj.journal_library,
obj.*
FROM
TABLE(QSYS2.OBJECT_STATISTICS('*ALL','*LIB')) AS lib
INNER JOIN LATERAL
(
SELECT lib.objname as objlibrary, xobj.*
FROM
TABLE(QSYS2.OBJECT_STATISTICS( lib.objname
, 'FILE')
) AS xobj
) AS obj
ON lib.objname = obj.objlibrary
WHERE obj.objattribute<>''
AND obj.journal_name='CKATRHIS';


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.