Using the VSMLIST work area

Prior to the first invocation of the VSMLIST macro for a single request, you must set the first four bytes of the work area to zero. This field will contain the return code of the VSMLIST macro after control returns to the issuer.

The VSMLIST service routine updates the work area and places the requested information in the data area located at the end of the work area. If the macro was executed successfully and all of the requested information fit into the data area, the VSMLIST service routine returns to the caller with a return code of 0 in the first four bytes of the work area. If the macro was executed successfully, but all of the requested information could not fit into the data area, the service routine returns to the caller with a return code of 4 in the first four bytes of the work area. In this case, the caller can reissue the macro as many times as necessary to obtain all of the information.

For multiple invocations of VSMLIST, the service routine continues supplying the information, starting where it left off on the previous invocation, provided the work area is not changed. However, multiple invocations do not provide cumulative results. For each invocation of a set of multiple invocations for a specific request:

You can avoid multiple invocations by enlarging the work area to hold all of the information. If you do enlarge the work area, be sure to set the first four bytes of the work area (the return code area) to zero before reissuing the macro.

Table 1. Description of VSMLIST Work Area
Bytes Field name Description
0-3 Return code This field contains the return code from the previous invocation of the VSMLIST macro. You must set this field to zero before the first invocation of the VSMLIST macro for a single request.
4-7 Address of data area The data area is located at the end of the work area and contains the information that you requested.
8-11 Length of the data area The data area varies in length and is limited in size by the length of the work area that you specified as a parameter of the VSMLIST macro.
12-15   Reserved for IBM® use
32-x   Reserved for IBM use
x-y Data area This area contains the actual output of the VSMLIST macro. The area varies in size and is limited by the length of the work area specified as a parameter of the macro.
The information returned in the data area depends on the parameters specified on the macro invocation. You can use the VSMLIST macro to obtain information about the following types of storage:

Except for subpool 245, an allocated block of storage is a multiple of 4K, some of which has been allocated through a GETMAIN or STORAGE macro. Free space within that block is the area that has not been allocated by a GETMAIN or STORAGE macro. An unallocated block of storage is some multiple of 4K, none of which has been allocated by a GETMAIN or STORAGE macro.

VSMLIST reports all SQA pages not allocated to subpools 226, 239, 247, and 248 as allocated to subpool 245. These pages of subpool 245 may not have been allocated by a GETMAIN or STORAGE macro.

The format of the information returned in the data area for each of these three types of requests follows.