Sorting AS/400 objects by size

1420 pts.
AS/400 memory
AS/400 objects
how to sort the objects by memory size in as400?

Answer Wiki

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

Try DSPOBJD to an outfile and then write a QRY over the outfile that sorts by the ODOBSZ field.
I’ll do this sometimes using *ALLUSR and object type *LIB to see which libraries are using a lot of disk space. Still need to view objects within the large libraries to get to actual usable info.

Discuss This Question: 4  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.
  • TomLiotta
    Build a list of objects and run the list through whichever sort function that you prefer. Can you clarify the question? Do you already have a list of objects? Do you need to know how to create a list of objects? Do you need to know what the different sorting functions are? What is your programming background? An appropriate answer might be different for particular backgrounds. Note that the RTVDSKINF and PRTDSKINF commands can provide some output sorted by size for /QSYS.LIB objects, and RTVDIRINF and PRTDIRINF can do similar for directory-based objects. Tom
    125,585 pointsBadges:
  • Rajasekhar15
    yes tom, 1. actually whenever i use the cmd dspobjd to see the memory size of the objects, i would like to see them in an order of mem size, its it possible. 2. its there anyother cmd to see the memory size of all obj? 3.when we use the cmd dspobjd, it shows the size in some numeric values (like ie: 543247), what is the actual size of it, whether its a byte or kilobyte ? Thanks
    1,420 pointsBadges:
  • Splat
    The DSPOBJD command presents the list of objects in alphabetic order; to see the DSPOBJD list in object size order you'd best use the OUTPUT(*OUTFILE) parameter and sort the resulting file. As Tom noted, the RTVDSKINF and PRTDSKINF commands are an alternative to the DSPOBJD command. You can also use the List Objects (QUSLOBJ) API with the OBJL0700 List Data Section format to retrieve a list of objects with size. I believe the order of the list is alphabetic, so you would again need to reorder the data to your satisfaction. Keep in mind that this format stores the size as both size and multiplier, so some calculation may be necessary. As for the DSPOBJD Size column, the interactive help text indicates the displayed information is the size of the object in bytes. There is also a caveat regarding output to a database file.
    9,635 pointsBadges:
  • Craig Hatmaker
    Rajasekhar - This project might be what you need. The link is to a PDF. The PDF explains how to setup RTVDSKINF to run each week. It goes on to explain how to modify an Excel template to work with your system. It also provides links to where the template can be downloaded from my personal dropbox. The Excel template can then be used to query RTVDSKINF output and sort objects by size, type, attribute, owner, changed date, last used date, name, etc. You can use it to drilldown into the first 1000 records in any PF or LF listed. It can even be used to track object growth. If you decide to use this, I would ask the favor of feedback (positive of negative) sent to the e-mail address at the end of the PDF. Best wishes - Craig
    1,855 pointsBadges:

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.


Share this item with your network: