On Wed, Jun 7, 2017 at 1:54 PM, George Rodriguez < 0000016eebd7289b-dmarc-requ...@listserv.ua.edu> wrote:
> 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). > ​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". > > 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN