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


Calculating the Size of the Work Area

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

For calculating the size of the work area, see the IBM storage device document specific to your device.

For fixed-length blocked records, the size of the main storage work area (SMSW) is calculated as follows:
   SMSW = (DS2HIRPR) (BLKSIZE + 8) + LRECL + KEYLEN
The formula for fixed-length unblocked records is
   SMSW = (DS2HIRPR) (KEYLEN + LRECL + 8) + 2

The value for DS2HIRPR is in the index (format-2) DSCB. If you do not use the MSWA and SMSW parameters, the control program supplies a work area using the formula BLKSIZE + LRECL + KEYLEN.

For variable-length records, SMSW can be calculated by one of two methods. The first method can lead to faster processing, although it might require more storage than the second method.

The first method is:
   SMSW = DS2HIRPR (BLKSIZE + 8) + LRECL + KEYLEN + 10
The second method is as follows:
SMSW = ( (Trk Cap - Bn + 1) / Block length) (BLKSIZE)
       + 8 (DS2HIRPR) + LRECL + KEYLEN + 10 + (REM - N - KEYLEN)

The second method yields a minimum value for SMSW. Therefore, the first method is valid only if its application results in a value higher than the value that would be derived from the second method. If neither MSWA nor SMSW is specified, the control program supplies the work area for variable-length records, using the second method to calculate the size.

In all the above formulas, the terms BLKSIZE, LRECL, KEYLEN, and SMSW are the same as the parameters in the DCB macro (Trk Cap=track capacity). REM is the remainder of the division operation in the formula and N is the first constant in the block length formulas. (REM-N-KEYLEN) is added only if its value is positive.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014