Is it possible to loop in JCL?
That is i want to insert around 20 DD DSN='file name', DISP=SHR for each file name.This is for the purpose of merging all these files to a single report file.
Now I am manually inserting each of these steps. If I have these file names in a seperate file is it possible by some means to insert DD DSN='file name', DISP=SHR for each of these files and then do a merge for these files?
This advise has one mainly reason: if you append data(with disposition MOD in ouptut) you must create first a dataset with correct space not released and so you may have two(but only one of that) problem: first is that space is not enough; the second is that unnecessary space, at the end of your work is not released.
If you want to persevere with MOD disposition you must to know that JCL can't loop but can only restart and to do what you need you can use: or a restart or a proc instream or catalogued.
In every case I suggest you to search in this forum before posting because this argument is aleady treated.