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


Specifying and Initializing Data Control Blocks

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

For each data set that you want to process, there must be a corresponding data control block (DCB) and data definition (DD) statement or its dynamic allocation equivalent. The characteristics of the data set and device-dependent information can be supplied by either source. As specified in z/OS MVS JCL User's Guide and z/OS MVS JCL Reference, the DD statement must also supply data set identification. Your program, SMS, and exit routines can supply device characteristics, space allocation requests, and related information. You establish the logical connection between a DCB and a DD statement by specifying the name of the DD statement in the DDNAME field of the DCB macro, or by completing the field yourself before opening the data set.

You can process a non-VSAM data set to read, update, or add data by following this procedure:

  1. Create a data control block (DCB) to identify the data set to be opened. A DCB is required for each data set and is created in a processing program by a DCB macro.

    When the program is run, the data set name and other important information (such as data set disposition) are specified in a JCL statement called the data definition (DD) statement, or in a call to dynamic allocation.

  2. Optionally supply a data control block extension (DCBE). You can supply options and test data set characteristics that the system stores in the DCBE.
  3. Connect your program to the data set you want to process, using the OPEN macro. The OPEN macro also positions volumes, writes data set labels and allocates virtual storage. You can consider various buffering macros and options.
  4. Request access to the data set. For example, if you are using BSAM to process a sequential data set, you can use the READ, WRITE, NOTE, or POINT macro.
  5. Disconnect your program from the data set, using the CLOSE macro. The CLOSE macro also positions volumes, creates data set labels, completes writing queued output buffers, and frees virtual and auxiliary storage.

Primary sources of information to be placed in the data control block are a DCB macro, data definition (DD) statement, a dynamic allocation SVC 99 parameter list, a data class, and a data set label. A data class can be used to specify all of your data set's attributes except data set name and disposition. Also, you can provide or change some of the information during execution by storing the applicable data in the appropriate field of the DCB or DCBE.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014