Just a few comments on Mr. Sample's post.
Robert Sample wrote:1. There is no looping facility in JCL.
Robert Sample wrote:2. Once submitted and passed through the converter / interpreter, the JCL cannot be changed.
Robert Sample wrote:3. Why not use HRECALL with a wild card? The error message doesn't matter.
HRECALL with a wild card and the WAIT parameter.
Robert Sample wrote:4. Have you discussed this process with your storage management group? You are attempting to pervert the storage management policies of your site and they rarely like that.
Robert Sample wrote:5. Is this a one-time thing or are you planning on doing this regularly? If a one-time thing, just manually look at all 100 data sets and issue HRECALL commands if appropriate. If you plan on doing this regularly (and discussed doing so with your storage management group), see if the storage management group has anything to help. If not, write a program in the language of your choice to parse the output of LISTCAT (or whatever you wind up using to get this data) and generate the JCL. Submit the final JCL to the internal reader.
I have a similar program that OPENs every dataset in a LISTCAT output just to update the referenced date, just to cheat storage management. But something like this is not a very good idea.
If you truly need a dynamic DD you most likely need to use Assembler and dynamic allocation. You let dynamic allocation assign the DD name, tell dynamic allocation to return the DD name, and you can go from there.