DSN01, DSN02, DSN03 will always be created in previous steps. DSN02 might be empty in some cases.
My question is: Is there any scenario in which original version will behave different from the modified version? Is the original version more efficient?
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
Yes, of course it is. It is, perhaps, an unusual usage and who knows why the writer of the JCL did that but it serves a purpose - to assign data set names to a ddname.
Yes DDNAME has its own purpose, but in this context you will see no effect because there are NO "DD statements between the forward reference and the concatenation".
Referenced DD statement
Try adding SYSUT1 before SYSUT2 in your Original version (which is not right now) and you will see only DSN01 is copied.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
I prepared and ran this JCL. The JOB statement and other identifiable information has been redacted. It has both versions of the IEBGENER step. The "TSO" step executes a private TIOT command located in the STEPLIB data set.
The SSDS code means subsystem data set. The command also obtains the data set name and, if it can find it, the EXCP count for the DD statement.
What happened?
It seems to me that when the JCL processor encounters DDNAME=xxx, it copies the data from the xxx DD statement and inserts it into the DD statement it is processing, and removes the referenced DD statement