On Wed, 7 Jun 2017 14:10:57 -0500, John McKown wrote: > >​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". > 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 [email protected] with the message: INFO IBM-MAIN
