We have been writing a REXX program to do smart reorgs. It looks at RTS or RUNSTATS and determines from the stats if it thinks that a REORG is necessary and then builds a LISTDEF for a REORG step further along in the JCL.
This is working nicely. But now I want to add some additional functionality to automatically detect AREO and REORP conditions and prioritise those tablespaces for reorg. But after much Googling and rummaging in the manuals I cannot seem to find a method of doing this as part of an SQL query.
So either it's not possible or I'm missing something obvious.
I'd already thought of scraping the information out of the -DIS DB command output. It's just that it doesn't integrate well the program I have thus far without making big changes. Finding a more SQL friendly way would be better, if one exists.
Such a feature exists in DB2 LUW, but IBM haven't replicated that functionality in the z/OS edition of their product, which is a shame.
I have figured out a way to go the -DISPLAY command route if I have to, but I didn't want to make any more work for myself than necessary if there was an SQL query that would do the job.