Extending the current size of a data space

When you create a data space and specify a maximum size larger than the initial size, you can use DSPSERV EXTEND to increase the current size as your program uses more storage in the data space. The BLOCKS parameter specifies the amount of storage you want to add to the current size of the data space.

The system increases the data space by the amount you specify, unless that amount would cause the system to exceed one of the following:
If one of those limits would be exceeded, the VAR parameter tells the system how to satisfy the EXTEND request.

If you use VAR=YES when you issue the EXTEND request, use the NUMBLKS parameter to find out the size by which the system extended the data space.

Figure 1 is an example of using the EXTEND request, where the current (and initial) size is 20,000 bytes and the maximum size is 100,000 bytes. If you want to increase the current size to 50,000 bytes, adding 30,000 blocks to the current size, you could code the following:
          DSPSERV EXTEND,STOKEN=DSSTOK,BLOCKS=DSPDELTA
          .
DSPDELTA DC  A((30000+4095)/4096)         DATA SPACE ADDITIONAL SIZE
DSSTOK   DS  CL8                          DATA SPACE STOKEN
The program can now use 50,000 bytes in the 100,000-byte data space, as shown in Figure 1:
Figure 1. Example of Extending the Current Size of a Data Space
ieaa6f71

Because the example did not include the VAR parameter, the system uses the default, VAR=NO.