Let's think outside this box a minute. GDG's were designed to group similar records by generation. The fact that they work for other things is just a bonus. This case is using GDG's as a "store and forward" type of process of unique files and GDG's are not designed for this. Two real solutions come to mind. 1) use a store-end-forward processor like MQSeries or 2) Single thread this so that each one is read/processed/deleted as it comes in, and no more can come in until that one is finished. (I doubt that a new GDG may be created while you are reading the oldest gdg anyhow). A third possibility which is kludgy would be to create each new DS with a unique DATETIME in the DSN and then do the catalog list and search for the oldest date. No roll-off, no problems with new GDGs coming in.
---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN