Old objects to be deleted in AS/400

750 pts.
Tags:
AS 400
I had my manager ask me about how we could go about finding out when objects were last used on the system. This would involve every library on the system. From what I was told, there are objects on the system that have been out there for many, many years and if these objects have not been used for a long time that they most likely could be deleted off the system. I believe the DSPOBJD command can be used, but how can I use it in mass for a library, considering a library can have thousands of objects in it? Once I create a file that has this information I would put it into a spread sheet, most likely it will be many pages long, but at least my manger would have a visual listing of objects with the date the object was last used. Programmers or those responsible can determine if those aged objects can be deleted.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

use the command but include all in the *LIBL or even use  *ALL

if you are just looking for FILES, but you may also want to look for old programs, queries and data areas Modify the command as needed

DSPOBJD OBJ(*LIBL/*ALL) OBJTYPE(*FILE) OUTPUT(*OUTFILE) OUTFILE(mylib/FILES)

or 

DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*FILE) OUTPUT(*OUTFILE) OUTFILE(mylib/FILES)

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • GregManzo
    Good answer from Todd. but I'd suggest using OBJ(*ALLUSR/*ALL) to ignore the IBM supplied libraries, especially if you go beyond files and do OBJTYPE(*ALL). But then add to it old history log files OBJ(QSYS/QHST*) OBJTYPE(*FILE).
    And don't forget about cleaning up old journal receivers (*JRNRCV).
    2,915 pointsBadges:
    report
  • TheRealRaven
    Handling old receivers is a good idea, but I'd base those decisions on save dates and retention requirements rather than on "last used" dates. That might also apply to QHST* files.
    33,000 pointsBadges:
    report
  • TheRealRaven
    For any processing of this kind, be very sure that you understand everything in the Detecting unused objects on the system topic in the Knowledge Center. It's not quite as simple as checking the "last used" date for a number of objects, object types and circumstances. For some object types, the only external accesses that can accurately tell you whether the object is "used" or not are IBM i Navigator or an appropriate API.
    33,000 pointsBadges:
    report
  • ToddN2000
    Another thing to consider is some jobs might get run at year end and show little activity. Also you may have some files that have historical data or backup versions of old source code of data from a previous release or upgrade you did. You may still want to keep these as well.
    127,535 pointsBadges:
    report
  • GregManzo
    Good point. Old files of year-end backups probably won't get touched again but there is still a legal requirement to keep all relevant tax data for 5 years from date of lodgement (at least in Oz). Having identified objects that haven't been used what you have is a list of candidates, you can't just rush out and delete them until someone has vetted the list.
    2,915 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: