Note that you should be speaking of generations[b], not versions[/b]. Fortunately, we have seen so many software engineers make that error it is easily recognizable to us.
Do a LISTCAT on the base, parse the list for the GDS names, and fabricate (or, preferably, tailor) and submit JCL and control cards as suit your fancy. So many software engineers have asked this question that there are examples on this board of all the code necessary; search the SMS/VSAM forum and this forum for it.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day