IBM Power Systems
About This Blog
Warm wishes and welcome to all AS400 Administrators and Operators.
This is exclusive blog for iSeries system Administrators working anywhere in the world. Also a place for guys and gals who want to share knowledge pertaining to iSeries. This blog has been designed for exchanging knowledge on AS400 or iSeries server administration and operations.
Wednesday, March 17, 2010
Listing Last Used Date / Creation Date for all Objects in a Library
Dump all objects in selected library to an outfile:
DSPOBJD OBJ(TESTLIBRARY/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) OUTFILE(QGPL/OBJDOUT)
Start SQL so we can select the necessary fields in the outfile:
STRSQL
Paste the following:
SELECT ODOBNM, ODLBNM, ODOBTP, ODUDAT, ODCDAT FROM qgpl/OBJDOUT
ORDER BY ODUDAT desc
This will create a display with objects creation date and last used date. You can also print to an outfile by using F13 on the Enter SQL Statements screen and changing the session attributes to print.
DSPOBJD OBJ(TESTLIBRARY/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) OUTFILE(QGPL/OBJDOUT)
Start SQL so we can select the necessary fields in the outfile:
STRSQL
Paste the following:
SELECT ODOBNM, ODLBNM, ODOBTP, ODUDAT, ODCDAT FROM qgpl/OBJDOUT
ORDER BY ODUDAT desc
This will create a display with objects creation date and last used date. You can also print to an outfile by using F13 on the Enter SQL Statements screen and changing the session attributes to print.
Subscribe to:
Post Comments (Atom)
Referring to this SQL stateement: SELECT ODOBNM, ODLBNM, ODOBTP, ODUDAT, ODCDAT FROM qgpl/OBJDOUT
ReplyDeleteORDER BY ODUDAT desc
The sequence won't be correct since ODudat is in MDY. you'd have to substring to the proper format, and as I remedmber, ODudat and ODcdat are numeric, so use DIGITS to convert to character for the substring.