Page 1 of 1

Which generation is read first if GDG base is input?

Posted: Wed Apr 05, 2023 12:35 pm
by Abhishek Mehta
Hi,

Yesterday I had an interview, the question was the newer version of a GDG gets placed where, I said bottom. But interviewer was not happy.

When I discussed this with my friends, one suggested that, "Possibly, it was not for locating them in ISPF 3.4. It was possibly to do with what if GDG Base is given as input to a program then newer version of a GDG gets placed where... in that chronological order."

So, which generation is read first if GDG base is input?

Re: Which generation is read first if GDG base is input?

Posted: Wed Apr 05, 2023 6:47 pm
by Robert Sample
Actually, the read order has depended upon the GDGORDER JCL parameter at least since 2017 (z/OS 2.1 approximately). The default order is GDGORDER=LIFO (last in, first out) so the generations will be read in descending generation order (that is, the latest created generation will be read first). With GDGORDER=FIFO, the generations will be read by age (oldest first).
the newer version of a GDG gets placed where
This statement is so vague as to be meaningless. "place where" could be where the GDG is cataloged, or where the data set is stored, or ... When a new generation is created, the generation number will ALWAYS be one higher than the previous generation (unless that generation was 9999 in which case the new generation number will be 0001).

Re: Which generation is read first if GDG base is input?

Posted: Sat Apr 08, 2023 12:12 am
by Abhishek Mehta
Thanks Robert.

Question is vague actually and I could not answer well. GDGORDER is a new concept, thanks for sharing it.