z/OS DFSMSdfp Advanced Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Handling End of Volume and End-Of-Data-Set Conditions

z/OS DFSMSdfp Advanced Services
SC23-6861-01

The EOV macro instruction identifies end-of-volume and end-of-data-set conditions. For an end-of-volume condition, EOV causes switching volumes and verifying or creating standard labels. For an end-of-data-set condition (except when another data set is concatenated), EOV causes your end-of-data set routine to be entered. Before processing trailer labels on a tape input data set, decrement the DCBBLKCT field. Your program issues EOV for any of the following reasons:
  • Switching magnetic tape or direct access volumes is necessary
  • Performing a secondary allocation on the same or another volume for a direct access data set opened for output
  • Switching to the next concatenated data set is necessary.

To determine how the system disposes of a tape volume when a program issues an EOV macro, see the description of the DISP parameter of the OPEN macro in z/OS DFSMS Macro Instructions for Data Sets.

For magnetic tape, issue EOV when either a tapemark is read or a write command received a unit exception condition. You can also issue EOV to go to the next volume or data set even though neither a tapemark was read nor end-of-tape reached. Bit settings in the 1-byte DCBOFLGS field ofthe DCB determine the action taken when EOV is executed. Before issuing EOV for magnetic tape or DASD make sure that appropriate bits are set in DCBOFLGS. Bit positions 2, 3, 6, and 7 of DCBOFLGS are used only by the system; you are concerned with bit positions 0, 1, 4, and 5. The use of these DCBOFLGS bit positions is as follows:

Table 1. DCBOFLGS Usage
Position Bit name Meaning
0 DCBOFLWR set to 1 indicates that a write command was executed and that a tapemark or DASD file mark is to be written. OPEN sets this bit to 1 if the OPEN option is OUTPUT, OUTIN, OUTINX, or EXTEND. OPEN sets it to 0 for any other OPEN option. For DASD, a 1 also indicates that ECBFDAD and DCBTRBAL contain valid information. See Device-Dependent Parameters for more information.
1 DCBOFLRB indicates that a backward read was the last I/O operation
4 DCBOFPPC indicates that concatenated data sets are to be treated as unlike. For further information, refer to z/OS DFSMS Using Data Sets.
5 DCBOFTM indicates that a tapemark has been read (tape only).

If bits 0 and 5 of DCBOFLGS are both off when EOV is executed, EOV spaces the tape past a tapemark, and standard labels, if present, are verified on both the old and new volumes. The direction of spacing depends on bit 1. If bit 1 is off, the tape is spaced forward; if bit 1 is on, the tape is backspaced.

For tape, if bit 0 is on, but bit 5 is off, EOV writes a tapemark at the current position, which is assumed to be following the last data record of the data set on the current volume. EOV also writes labels on both the old and new tapes if they are labeled. See z/OS DFSMS Using Magnetic Tapes for information on label processing. For DASD, if bit 0 is on, EOV attempts to write a file mark. See the DCBFDAD description in Device-Dependent Parameters for more information.

When you issue EOV, the system might rebuild the DEB at another location. After each EOV, obtain the rebuilt DEB address from the DCB. If the data set was allocated without the nocapture option of dynamic allocation, then EOV might have uncaptured the UCB for the previous volume. If so, that captured UCB address might become invalid. Note that the 24-bit address of the new UCB might be the same as the previous UCB.

After issuing EOV for sequentially organized output data sets on direct access volumes, you can determine whether additional space was obtained on the same or a different volume. Do this by examining the DEB and the UCB. If the volume serial number in the UCB has not changed, additional space was obtained on the same volume. Otherwise, space was obtained on a different volume.

The format of the EOV macro is:

Read syntax diagramSkip visual syntax diagram
>>-+-------+--EOV--dcb_addr--+---------------+-----------------><
   '-label-'                 |        .-24-. |   
                             '-,MODE=-+-31-+-'   

dcb_addr—RX-type address, (2-12), or (1)
The address of the DCB that is opened for the data set. If this parameter is specified as (1), register 1 must contain this address.
MODE=24 or 31
Indicates how the registers are set. With either value, your program can be in 24-bit or 31-bit mode. The modes are:
24
If you do not specify the MODE operand, this mode is assumed. The expansion of the EOV macro stores the DCB address into register 1. The high-order byte of register 1 is ignored during EOV processing. The DCB must be below 16MB, but the calling program can be above the line.
31
The EOV macro expansion code puts the DCB address into register 15 and sets register 1 to zeros. The DCB address must be below 16 MB, because providing a DCB above 16 MB causes an ABEND50D. The high-order byte of the address specified in the EOV macro must be zero.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014