IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DDNAME parameter


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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

PostPosted: Mon Dec 19, 2016 4:41 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Dec 20, 2016 3:05 am
Reply with quote

NEXTDD will always be appended. Did you execute them to know the results?
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Dec 20, 2016 1:55 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Dec 20, 2016 3:05 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Dec 20, 2016 10:05 pm
Reply with quote

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
View user's profile Send private message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Fri Dec 23, 2016 10:20 pm
Reply with quote

I think both versions will produce equal performance as the original version will not consume any additional CPU cycle.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sat Dec 24, 2016 7:08 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top