25 pts.
 What non IBM programs are actually run.
The site I'm involved with has 1000's of programs but I'm been told most are obsolete. Is there any way I can determine what programs are executed?

Software/Hardware used:
os 7.1
ASKED: February 11, 2013  11:17 AM
UPDATED: February 11, 2013  1:08 PM

Answer Wiki:
DSPOBJD OBJ(&Lib/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) 
OUTFILE(QGPL/ALLOBJECTS)
On the AS400, you need to look at last used date on the objects. you can create and file of all objects in a library by using the DSPOBJD command. Here is a sample. You can query this file, or send it out as a .csv so you cna use Excel to analyze it. Look at the last used date and the creation date.If the last used date is blank and the creation date is not very recent, it is not used.  
Last Wiki Answer Submitted:  February 12, 2013  8:32 pm  by  Timothy01   25 pts.
All Answer Wiki Contributors:  Timothy01   25 pts. , Michael Tidmarsh   11,390 pts. , CharlieBrowne   32,835 pts. , Harisheldon   5,475 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

The DSPOBJD command is a useful way to build a quick list of objects. I would use OBJTYPE(*PGM) instead of *ALL, and I’d put the outfile in QTEMP or a personal library rather than in QGPL.
 
Once the file is built, you could run various queries over it. SQL could show all programs used since 2011:

SELECT ODOBNM, ODUDAT FROM qtemp/objd
  WHERE substr(ODUDAT,5,2) > ’11′

That selects programs with a LastUsed year greater than ’11′ (but be aware of 1999 and earlier).  Alternatively, you might choose to make the list smaller:

DELETE FROM qtemp/objd
  WHERE substr(ODUDAT,5,2) < ’12′ OR substr(ODUDAT,5,2) > ’13′

That gets rid of all rows that have LastUsed year before 2012 (including any from 1999 or earlier).
 
By reversing the WHERE logic, you would get rid of rows for programs that have been used in 2012 and 2013. The remaining rows would be programs that haven’t been used in more than a full calendar year.
 
The DSPOBJD command can be run multiple times to build the list fresh again. Queries can select different year ranges to let you cut the list down a few years at a time. Before deleting programs, you might verify that any source still exists. Instead of deleting, you might use MOVOBJ to move them to an archive library. That helps retain ownership and authority. The archive library can be saved later and restored if needed.
 
After programs are handled, you might want to review other object types by changing the OBJTYPE() parameter.
 
Tom

 107,995 pts.