As pointed out earlier, JCL goes through the converter / interpreter process when the job is read into the system. Hence it is not possible for you to modify the JCL of an executing job, under any circumstances, ever. So if you expect to have JCL to allocate a dynamic data set DD statement in the same job, that's not going to happen. You could write a program using the language of your choice to use BPXWDYN to dynamically allocate a data set (which does not require a DD statement in the JCL) and access it that way. However, if you insist on having a DD statement, you have no choice but to submit a job through the internal reader that contains the DD statement.I tried to use temp datasets to store the desired dynamic dataset name and allocate it in the following steps but it did not work. I would like to it in the same run of the job.