z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Changing an Address in the DCB

z/OS DFSMS Using Data Sets
SC23-6855-00

Figure 1 shows how to change a field in the DCB.
Figure 1. Changing a Field in the DCB
               ...
               OPEN     (TEXTDCB,INOUT),MODE=31
               ...
   EOFEXIT     CLOSE    (TEXTDCB,REREAD),MODE=31,TYPE=T
               LA       10,TEXTDCB
               USING    IHADCB,10
               MVC      DCBSYNAD+1(3),=AL3(OUTERROR)
               B        OUTPUT
   INERROR     STM      14,12,SYNADSA+12
               ...
   OUTERROR    STM      14,12,SYNADSA+12
               ...
   TEXTDCB     DCB      DSORG=PS,MACRF=(R,W),DDNAME=TEXTTAPE,   C
                        EODAD=EOFEXIT,SYNAD=INERROR
               DCBD     DSORG=PS
               ...

The data set defined by the data control block TEXTDCB is opened for both input and output. When the application program no longer needs it for input, the EODAD routine closes the data set temporarily to reposition the volume for output. The EODAD routine then uses the dummy control section IHADCB to change the error exit address (SYNAD) from INERROR to OUTERROR.

The EODAD routine loads the address TEXTDCB into register 10, the base register for IHADCB. Then it moves the address OUTERROR into the DCBSYNAD field of the DCB. Even though DCBSYNAD is a fullword field and contains important information in the high-order byte, change only the 3 low-order bytes in the field.

All unused address fields in the DCB, except DCBEXLST, are set to 1 when the DCB macro is expanded. Many system routines interpret a value of 1 in an address field as meaning no address was specified, so use it to dynamically reset any field you do not need.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014