for Your foggy request
//input DD ......
//output DD DISP=(NEW,CATLG),DSN=somegdgbasename(+1),
// all the other DD parameters
input is the input dataset ( irrelevant if it is temporary or not )
somepgm is a program capable of copying the input to the output
output will be the newly created gdg generation