Based on a discussion here, I got curious on how OPEN in append mode (DISP=MOD) 
finds the end of the current data in a DASD PS data set. I do have some 
knowledge about VTOC and DSCBs but just never thought about this very question 
in detail.

Some of the actions below do not apply if the data set resides on one volume 
only (i.e. it is *not* multivolume).

This my current assumption. I'm not so much concerned about the fact that some 
information from the VTOCs is being mapped to internal control blocks (e.g. 
DEB) and by what code and when. I'm concentrating on the data in the VTOC and 
how is is used.


1. Allocation (?) has built a list of volumes where the data set has currently 
some space allocated.

2. OPEN needs to find the last volume on which there is current data. DSCB flag 
DS1IND80 indicates of this is the "Last volume contsining data in this data 
set".

I understand this flag to indicate the last volume with current valid data, not 
the last volume where the data set has some space allocated. I.e. if a data set 
gets expanded to a second volume while writing data, I assume this flag is OFF 
on the first but ON on the second volume. If the data set gets rewritten 
(DISP=OLD), and all data written this time fits on the first volume, then the 
flag would be turned ON on the first volume. The data set still has some, now 
unused, space allocated on the second volume, but the VTOC and all tracks are 
left unchanged in this case.

3. Once the last volume is identified, OPEN needs to find the end of current 
valid data on that volume. DS1LSTAR and possibly DS1TTTHI identify the last 
track (and block on that track) that has valid data. OPEN needs to map that 
track number to a cylinder-track address with the help of the extents 
information (DSCB1/DSCB3s).



If the above is roughly correct, then processing for OPEN in append mode will 
increase with the number of extents and volumes. On the other hand, processing 
for OPEN in replace mode (DISP=OLD) will not change, no matter on how many 
extents/volumes the data set has allocated from previous processing.



I appreciate any comment and correction.


--
Peter Hunkeler

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to