|
View previous topic :: View next topic
|
| Author |
Message |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi,
A job is using DDNAME parameter in one of the step as shown below:
| Code: |
Modified Version | Original Version
++++++++++++++++++++++++++++++++|+++++++++++++++++++++++++++++++++
//STEP01 EXEC PGM=IEBGENER | //STEP01 EXEC PGM=IEBGENER
//SYSIN DD DUMMY | //SYSIN DD DUMMY
//SYSOUT DD SYSOUT=* | //SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=* | //SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=* | //SYSUT2 DD SYSOUT=*
//SYSUT1 DD DSN=&&DSN01, | //SYSUT1 DD DDNAME=FIRSTDD
// DISP=(OLD,DELETE) | //FIRSTDD DD DSN=&&DSN01,
// DD DSN=&&DSN02, | // DISP=(OLD,DELETE)
// DISP=(OLD,DELETE) | // DD DSN=&&DSN02,
// DD DSN=&&DSN03, | // DISP=(OLD,DELETE)
// DISP=(OLD,DELETE) | // DD DDNAME=NEXTDD
| //NEXTDD DD DSN=&&DSN03,
| // DISP=(OLD,DELETE) |
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? |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| NEXTDD will always be appended. Did you execute them to know the results? |
|
| Back to top |
|
 |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
| Yes. I did execute both the jobs and getting the same results. I was just wondering if DDNAME is serving any specific purpose in this context. |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 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. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
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. |
|
| Back to top |
|
 |
mohitsaini Warnings : 1 New User
Joined: 15 May 2006 Posts: 92
|
|
|
|
| I think both versions will produce equal performance as the original version will not consume any additional CPU cycle. |
|
| Back to top |
|
 |
steve-myers
Active Member
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.
| Code: |
//A EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
DSN01
//SYSUT2 DD DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,1),DSN=&&DSN01
//SYSIN DD DUMMY
//B EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
DSN02
//SYSUT2 DD DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,1),DSN=&&DSN02
//SYSIN DD DUMMY
//C EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
DSN03
//SYSUT2 DD DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,1),DSN=&&DSN03
//SYSIN DD DUMMY
//D EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=(OLD,PASS),DSN=&&DSN01
// DD DISP=(OLD,PASS),DSN=&&DSN02
// DD DISP=(OLD,PASS),DSN=&&DSN03
//SYSUT2 DD SYSOUT=*
//SYSIN DD DUMMY
//E EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DDNAME=FIRSTDD
//SYSUT2 DD SYSOUT=*
//SYSIN DD DUMMY
//FIRSTDD DD DISP=(OLD,PASS),DSN=&&DSN01
// DD DISP=(OLD,PASS),DSN=&&DSN02
// DD DDNAME=LASTDD
//LASTDD DD DISP=(OLD,PASS),DSN=&&DSN03
//F EXEC PGM=IKJEFT01,PARM=TIOT
//STEPLIB DD DISP=(SHR,PASS),DSN=&SYSUID..LOAD
// DD DISP=(SHR,PASS),DSN=&SYSUID..OLOAD
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSUT1 DD DDNAME=FIRSTDD
//SYSUT2 DD SYSOUT=*
//SYSIN DD DUMMY
//FIRSTDD DD DISP=(OLD,PASS),DSN=&&DSN01
// DD DISP=(OLD,PASS),DSN=&&DSN02
// DD DDNAME=LASTDD
//LASTDD DD DISP=(OLD,PASS),DSN=&&DSN03
|
The "original" JCL in step E just processed the first data set. An analysis of the TIOT from the TSO step gives a clue as to what actually happened.
| Code: |
XXXXXXJ F
STEPLIB 0A38 VVVV08 2 XXXXXX.LOAD
0A6B VVVV1B 0 XXXXXX.OLOAD
SYSTSPRT SSDS
SYSTSIN DMY
SYSUT1 0A2E WRK002 0 SYS16358.T195722.RA000.XXXXXXJ.DSN01.H01
SYSUT2 SSDS
SYSIN DMY
0A2F WRK003 0 SYS16358.T195722.RA000.XXXXXXJ.DSN02.H01
0A2E WRK002 0 SYS16358.T195722.RA000.XXXXXXJ.DSN03.H01 |
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 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|