How scope and token values determine the information GQSCAN returns

Table 1 and Table 2 summarize the possible values and the information returned for a GQSCAN request.

Table 1. GQSCAN Results with a Scope of STEP, SYSTEM, SYSTEMS, or ALL
GQSCAN Invocation TOKEN Parameter Coded? Information Returned
Initial call No At least the first RIB that represents the first requestor on the resource queue, and as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned to the caller.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and at least one of its RIBEs.

Initial call Yes; value is zero At least the first RIB that represents the first requestor on the resource queue, and as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned to the caller.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and all of its RIBEs.

Subsequent call No At least the first RIB that represents the first requestor on the resource queue, and as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned to the caller.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and at least one of its RIBEs.

Subsequent call Yes; value is the token value returned by GQSCAN on the preceding call At least the next RIB on the resource queue, with as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned to the caller.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and all of its RIBEs.

The example in Figure 1 shows the area contents for three requests. For each request, the caller specified the TOKEN parameter and one of the following for the scope value: STEP, SYSTEM, SYSTEMS, or ALL. Assume that the resource queue contains information about four resources: A, which has three requestors; B, which has six; C, which has two; and D, which has one.
Figure 1. Work Area Contents for GQSCAN with a Scope of STEP, SYSTEM, SYSTEMS, or ALL
iea99819

Note that, because the specified area is not large enough, the caller cannot receive all of the RIBEs associated with resource B, even though the caller coded the TOKEN parameter. To receive all of those RIBEs, the caller has to specify a larger area and reissue the GQSCAN request. Authorized callers (those who can specify SCOPE=LOCAL or SCOPE=GLOBAL) do not need to alter the size of the area they provide, as long as they specify the TOKEN parameter; they can receive additional RIBEs on subsequent calls to GQSCAN.

Table 2. GQSCAN Results with a Scope of LOCAL or GLOBAL
GQSCAN Invocation TOKEN Parameter Coded? Information Returned
Initial call No At least the first RIB that represents the first requestor on the resource queue, and as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned to the caller.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and at least one of its RIBEs.

Initial call Yes; value is zero At least the first RIB that represents the first requestor on the resource queue, and as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned unless you issue GQSCAN again, with the TOKEN parameter equal to the value that GQSCAN returns on this call.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and at least one of its RIBEs.

Subsequent call No At least the first RIB that represents the first requestor on the resource queue, and as many of that RIB's associated RIBEs as will fit. Any RIBEs that do not fit are not returned to the caller.

If all of the RIBEs fit, GQSCAN returns the next RIB on the resource queue, as long as the remaining area is large enough to hold that RIB and at least one of its RIBEs.

Subsequent call Yes; value is the token value returned by GQSCAN on the preceding call If GQSCAN was unable to return all of the RIBEs for the last RIB returned on the preceding call, the information returned is that last RIB and its remaining RIBEs, plus any additional RIBs and their associated RIBEs as will fit.

Otherwise, GQSCAN returns at least the next RIB on the resource queue and as many of that RIB's associated RIBEs as will fit.

The example in Figure 2 shows the area contents for three requests. For each request, the caller specified the TOKEN parameter and one of the following for the scope value: LOCAL or GLOBAL.
Figure 2. Work Area Contents for GQSCAN with a Scope of LOCAL or GLOBAL
ieaa8820

When scanning the information returned, you must use the size of the fixed portion of the RIB and the RIBE that is returned in register 0. The size of the fixed portion of the RIB (RIBLEN) is in the high-order half of register 0, and the size of the RIBE (RIBELEN) is in the low-order half.

The first RIB starts at the beginning of the workarea you specify on the AREA parameter. To find the first RIBE, add the value of RIBLEN and the variable portion of RIB (as found in the RIBVLEN field of the RIB) to the address of the workarea. To find the second RIBE, add the value of RIBELEN to the address of the first RIBE.

To find the second RIB, add the following to the location of the first RIB:
RIBLEN + RIBVLEN + (the number of RIBEs x RIBELEN)