Peter, I don't know if this could be the base of what you need, however I'd like to point you to a github page for something that Walmart did for generating unique zUID, guaranteed to be unique until the year 34,000 (built with patent pending algorithm). It was built as a cloud solution, however it says in the initial page that it can be called from a cics program.
Here's the link: https://github.com/walmartlabs/zUID Peter ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN