Discussion:
What Happens with Duplicate DD Cards in JCL?
(too old to reply)
George Rodriguez
2017-06-07 18:53:41 UTC
Permalink
Raw Message
I have this programmer that coded the following DD cards in JCL. I'm not
100% sure what z/OS v1.13 does with the first DD card for a KSDS VSAM file,
but I think it gets replaced by the second. Here is an example of the JCL:

//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE

My thought, second PBSF1 (test file) replaces PBSF1 (production file).

Thanks in advance!

*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
--
*Disclaimer: *Under Florida law, e-mail addresses are public records. If
you do not want your e-mail address released in response to a public
records request, do not send electronic mail to this entity. Instead,
contact this office by phone or in writing.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Lizette Koehler
2017-06-07 19:00:31 UTC
Permalink
Raw Message
I think it depends on how the program handles it.

Do you get any JCL errors?

Do you get any errors when the program runs like this?

Any details you can share?

Lizette
-----Original Message-----
Behalf Of George Rodriguez
Sent: Wednesday, June 07, 2017 11:54 AM
Subject: What Happens with Duplicate DD Cards in JCL?
I have this programmer that coded the following DD cards in JCL. I'm not 100%
sure what z/OS v1.13 does with the first DD card for a KSDS VSAM file, but I
//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE
My thought, second PBSF1 (test file) replaces PBSF1 (production file).
Thanks in advance!
*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
--
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
George Rodriguez
2017-06-07 19:33:45 UTC
Permalink
Raw Message
I thought that too a JCL error, but no the programmer didn't get a JCL
error! ​


*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
Post by Lizette Koehler
I think it depends on how the program handles it.
Do you get any JCL errors?
Do you get any errors when the program runs like this?
Any details you can share?
Lizette
-----Original Message-----
Behalf Of George Rodriguez
Sent: Wednesday, June 07, 2017 11:54 AM
Subject: What Happens with Duplicate DD Cards in JCL?
I have this programmer that coded the following DD cards in JCL. I'm not
100%
sure what z/OS v1.13 does with the first DD card for a KSDS VSAM file,
but I
//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE
My thought, second PBSF1 (test file) replaces PBSF1 (production file).
Thanks in advance!
*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
--
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
*Disclaimer: *Under Florida law, e-mail addresses are public records. If
you do not want your e-mail address released in response to a public
records request, do not send electronic mail to this entity. Instead,
contact this office by phone or in writing.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Beaver
2017-06-07 19:40:16 UTC
Permalink
Raw Message
When I used to work on CPCS, we would stack 10 SYSUDUMP DDCARDS in the JCL so we could CLOSE with a FREE=CLOSE and get the dump

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of George Rodriguez
Sent: Wednesday, June 7, 2017 2:34 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: What Happens with Duplicate DD Cards in JCL?

I thought that too a JCL error, but no the programmer didn't get a JCL error! ​


*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
Post by Lizette Koehler
I think it depends on how the program handles it.
Do you get any JCL errors?
Do you get any errors when the program runs like this?
Any details you can share?
Lizette
-----Original Message-----
From: IBM Mainframe Discussion List
Sent: Wednesday, June 07, 2017 11:54 AM
Subject: What Happens with Duplicate DD Cards in JCL?
I have this programmer that coded the following DD cards in JCL. I'm not
100%
sure what z/OS v1.13 does with the first DD card for a KSDS VSAM file,
but I
//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE
My thought, second PBSF1 (test file) replaces PBSF1 (production file).
Thanks in advance!
*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
--
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send
--
*Disclaimer: *Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Jim Brooks
2017-06-07 19:06:10 UTC
Permalink
Raw Message
From the "MVS JCL Reference" Manual ....

v Each ddname should be unique within the job step. If duplicate ddnames
appear
in a job step, processing is as follows:
– In a JES2 system: The system performs device and space allocation and
disposition processing for both DD statements; however, it directs all
references to the first DD statement in the step.
– In a JES3 system: If both DD statements request JES3 or jointly-managed
devices, the system cancels the job during JES3 interpretation. If only one
or
neither DD statement requests a JES3 or jointly-managed device, the system
performs device and space allocation processing for both DD statements;
however, it directs all references to the first DD statement in the step.

Regards,
Jim

On Wed, Jun 7, 2017 at 2:54 PM, George Rodriguez <
Post by George Rodriguez
I have this programmer that coded the following DD cards in JCL. I'm not
100% sure what z/OS v1.13 does with the first DD card for a KSDS VSAM file,
//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE
My thought, second PBSF1 (test file) replaces PBSF1 (production file).
Thanks in advance!
*George Rodriguez*
*Specialist II - IT Solutions*
*IT Enterprise Applications*
*PX - 47652*
*(561) 357-7652 (office)*
*(954) 415-7586 (mobile)*
*School District of Palm Beach County*
*3348 Forest Hill Blvd.*
*Room B-251*
*West Palm Beach, FL. 33406-5869*
*Florida's Only A-Rated Urban District For Eight Consecutive Years*
--
*Disclaimer: *Under Florida law, e-mail addresses are public records. If
you do not want your e-mail address released in response to a public
records request, do not send electronic mail to this entity. Instead,
contact this office by phone or in writing.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2017-06-07 19:09:58 UTC
Permalink
Raw Message
On Wed, Jun 7, 2017 at 1:54 PM, George Rodriguez <
Post by George Rodriguez
I have this programmer that coded the following DD cards in JCL. I'm not
100% sure what z/OS v1.13 does with the first DD card for a KSDS VSAM file,
//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE
My thought, second PBSF1 (test file) replaces PBSF1 (production file).
​What happens is that the TIOT (internal representation of the DD
statements for the step) will contain _both_ entries. The TIOT is a
sequential list of entries. OPEN will search the TIOT from top to bottom
looking for the requested DD name. It will therefore find the first
(production) one. You can use this for some really strange effects.
Consider the following:

//INPUT DD DSN=some.dsn,DISP=SHR,FREE=CLOSE
//INPUT DD DSN=another.dsn,DISP=SHR,FREE=CLOSE


Now suppose the program does something like (pseudo code of course):

OPEN INPUT
...
CLOSE INPUT
OPEN INPUT
...
CLOSE INPUT
RETURN

The first OPEN INPUT will have the program access "some.dsn". The first
CLOSE will cause that DD to be dynamically freed & taken out of the TIOT.
So the second OPEN INPUT will access "another.dsn". After the second CLOSE
INPUT, the second TIOT entry will be released. So a 3rd OPEN INPUT would
get "DD statement INPUT not found".
Post by George Rodriguez
Thanks in advance!
--
Prof: So the American government went to IBM to come up with a data
encryption standard and they came up with ...

Student: EBCDIC!

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2017-06-07 19:45:41 UTC
Permalink
Raw Message
CLOSE will cause that DD to be ... taken out of the TIOT
I didn't know that!

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of John McKown
Sent: Wednesday, June 7, 2017 12:11 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: What Happens with Duplicate DD Cards in JCL?
I have this programmer that coded the following DD cards in JCL. I'm
not 100% sure what z/OS v1.13 does with the first DD card for a KSDS
//PRTOUT DD SYSOUT=X
//* VSAM FILES
//PBGDD DD DSN=TM#TEST.FILE
//PBSF1 DD DSN=TM#PROD.FILE
//PBSF1 DD DSN=TM#TEST.FILE
My thought, second PBSF1 (test file) replaces PBSF1 (production file).
​What happens is that the TIOT (internal representation of the DD statements for the step) will contain _both_ entries. The TIOT is a sequential list of entries. OPEN will search the TIOT from top to bottom looking for the requested DD name. It will therefore find the first
(production) one. You can use this for some really strange effects.
Consider the following:

//INPUT DD DSN=some.dsn,DISP=SHR,FREE=CLOSE //INPUT DD DSN=another.dsn,DISP=SHR,FREE=CLOSE


Now suppose the program does something like (pseudo code of course):

OPEN INPUT
...
CLOSE INPUT
OPEN INPUT
...
CLOSE INPUT
RETURN

The first OPEN INPUT will have the program access "some.dsn". The first CLOSE will cause that DD to be dynamically freed & taken out of the TIOT.
So the second OPEN INPUT will access "another.dsn". After the second CLOSE INPUT, the second TIOT entry will be released. So a 3rd OPEN INPUT would get "DD statement INPUT not found".

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2017-06-07 20:07:49 UTC
Permalink
Raw Message
Post by Charles Mills
CLOSE will cause that DD to be ... taken out of the TIOT
I didn't know that!
I guess that I should have said "effectively taken out of the TIOT". I
don't think that the TIOT is "compressed", but that the entry is either
"zeroed out" or somehow marked as "inactive". But I don't really remember
which it is. It's been too long.
Post by Charles Mills
Charles
--
Prof: So the American government went to IBM to come up with a data
encryption standard and they came up with ...

Student: EBCDIC!

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2017-06-07 19:38:20 UTC
Permalink
Raw Message
Post by John McKown
​What happens is that the TIOT (internal representation of the DD
statements for the step) will contain _both_ entries. The TIOT is a
sequential list of entries. OPEN will search the TIOT from top to bottom
looking for the requested DD name. It will therefore find the first
(production) one. You can use this for some really strange effects.
//INPUT DD DSN=some.dsn,DISP=SHR,FREE=CLOSE
//INPUT DD DSN=another.dsn,DISP=SHR,FREE=CLOSE
OPEN INPUT
...
CLOSE INPUT
OPEN INPUT
...
CLOSE INPUT
RETURN
The first OPEN INPUT will have the program access "some.dsn". The first
CLOSE will cause that DD to be dynamically freed & taken out of the TIOT.
So the second OPEN INPUT will access "another.dsn". After the second CLOSE
INPUT, the second TIOT entry will be released. So a 3rd OPEN INPUT would
get "DD statement INPUT not found".
My vague recollection of something I never do intentionally is that
referbacks in subsequent job steps search the TIOT from bottom to
top, so a referback will find "another.dsn".

This all feels like a desigh blunder that IBM was too indolent to repair.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2017-06-07 20:12:50 UTC
Permalink
Raw Message
Post by John McKown
Post by Charles Mills
CLOSE will cause that DD to be ... taken out of the TIOT
I didn't know that!
I guess that I should have said "effectively taken out of the TIOT". I
don't think that the TIOT is "compressed", but that the entry is either
"zeroed out" or somehow marked as "inactive". But I don't really remember
which it is. It's been too long.
But I believe an essential part, that got trimmed, is FREE=CLOSE.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Beaver
2017-06-07 20:20:41 UTC
Permalink
Raw Message
Gil is correct == the FREE=CLOSE does the real dirty work

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin
Sent: Wednesday, June 7, 2017 3:14 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: What Happens with Duplicate DD Cards in JCL?
Post by John McKown
Post by Charles Mills
CLOSE will cause that DD to be ... taken out of the TIOT
I didn't know that!
I guess that I should have said "effectively taken out of the TIOT". I
don't think that the TIOT is "compressed", but that the entry is either
"zeroed out" or somehow marked as "inactive". But I don't really
remember which it is. It's been too long.
But I believe an essential part, that got trimmed, is FREE=CLOSE.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...