Thoughts on the following:
*-- Based on the handout available at
https://learn.common.org/products/sql-for-system-and-storage-management#tab-product_tab_handouts
<
https://learn.common.org/products/sql-for-system-and-storage-management#tab-product_tab_handouts>*
*-- Delete objects first.*SELECT 'DEL OBJLNK(''' *CONCAT* PATH_NAME *CONCAT*
''')',
QCMDEXC('DEL OBJLNK(''' *CONCAT* PATH_NAME *CONCAT* ''')'),
IFS.*
FROM TABLE (
QSYS2.IFS_OBJECT_STATISTICS('/QIBM/UserData/OS400/SQE',
OBJECT_TYPE_LIST *=>* '*ALLSTMF')
) IFS
WHERE OBJECT_CHANGE_TIMESTAMP < *CURRENT TIMESTAMP* - *100* *DAYS*
;
*-- Delete directories next*SELECT 'RD DIR(''' *CONCAT* PATH_NAME *CONCAT*
''')',
QCMDEXC('RD DIR(''' *CONCAT* PATH_NAME *CONCAT* ''')'),
IFS.*
FROM TABLE (
QSYS2.IFS_OBJECT_STATISTICS('/QIBM/UserData/OS400/SQE',
OBJECT_TYPE_LIST *=>* '*ALLDIR')
) IFS
WHERE OBJECT_CHANGE_TIMESTAMP < *CURRENT TIMESTAMP* - *100* *DAYS*
AND PATH_NAME <> '/QIBM/UserData/OS400/SQE'
;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2026 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.