× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here is the IBM KB article information:




Determining the Offsets for Pool Information Using the Retrieve System
Status (QWCRSSTS) API






Incident Summary

Problem Summary:
Format SSTS0400 of t he Retrieve System Status (QWCRSSTS) API is called
from a CL program to retrieve the pool information from the system. The
incorrect value is returned for the Tuning Maximum Pool Size %
parameter. The WRKSHRPOOL command screen showed the correct pool
information.

Resolution:
The user was using the incorrect offset for the Pool Information in the
CL program. The program was using offset 151 and 155, but the correct
data was at offset 157 and 161. The offset is determined as follows:

The offset to Pool Information is returned by the API. For R520, the
offset for the Pool Information is 56 ; however, if more information is
added to the header, it could change in a future release. You could use
the offset returned by the API in the program to protect against a
future change in offset. For example, using the attached program rather
than hard coding 101 for the pool name allows use of the returned pool
information offset, plus 45 for the position of the pool name in the
pool information:

dcl &offsetpool *dec 8 0 /* decimal offset to pool information */
dcl &offset *dec 8 0 /* offset to information in pool information */
chgvar &offsetpinf (%sst(&rcvvar 49 4)) /* get pool information offset
from receiver */
chgvar &offsetpool (%bin(&offsetpinf)) /* convert to pool information
offset to decimal */
chgvar &offset (&offsetpool + 45) /* add to get offset to pool name in
receiver */
chgvar &poolnam (%sst(&rcvvar &offset 10)) /* get pool name from
receiver */

The SSTS0400 format structure below is documentation taken from the
QWCRSSTS API using the InfoCenter Web site. It returns a header portion
that has the offsets documented. Following the header is information for
each pool. The offset to that information is returned in the header in
field:

48

30

BINARY(4)

Offset to pool information


This is the field that contains the 56 (offset to first pool returned)
mentioned above. Because the program requests only one pool to be
returned, the user has taken the shortcut of determining the offsets to
a couple of the fields in the pool information. The pool information
does not have the offsets documented for you. However, if we filled in
relative offsets (from the start of pool information rather than the
entire receiver), they would be:

0

BINARY(4)

System pool

4

BINARY(4)

Pool size

8

BINARY(4)

Reserved size

12

BINARY(4)

Maximum active threads

16

BINARY(4)

Database faults

20

BINARY(4)

Database pages

24

BINARY(4)

Nondatabase faults

28

BINARY(4)

Nondatabase pages

32

BINARY(4)

Active to wait

36

BINARY(4)

Wait to ineligible

40

BINARY(4)

Active to ineligible

44

CHAR(10)

Pool name

54

CHAR(10)

Subsystem name

64

CHAR(10)

Subsystem library name

74

CHAR(10)

Paging option

84

BINARY(4)

Defined size

88

BINARY(4)

Current threads

92

BINARY(4)

Current ineligible threads

96

BINARY(4)

Tuning priority

100

BINARY(4)

Tuning minimum pool size %

104

BINARY(4)

Tuning maximum pool size %



BINARY(4)

Tuning minimum faults



BINARY(4)

Tuning per-thread faults



BINARY(4)

Tuning maximum faults



CHAR(50)

Description



CHAR(1)

Status



CHAR(*)



To get the offset to the Tuning minimum pool size % from the beginning
of the receiver, get the offset to the pool information (56 ) and add
the offset of the minimum percent within the pool information 100 . You
add 1 to go from an offset to a position in CL sub-stringing:

157 = 56 + 100 + 1

The concern about not hardcoding the offset is in the InfoCenter in the
OS/400 API concepts section:

Offset Values and Lengths

When using an API that generates a list into a user space, the offset
values and lengths returned by the API in the generic user space header
must be used to step through the list rather than specifying what the
current version of the API returns. This is the result of:

o

The offset values to the different sections of the user space may change
in future releases.

o

The length of the entries in the list data section of the user space may
change in future releases.

As long as the HLL application program uses the offset values and
lengths returned in the generic header of the user space, your program
will run in future releases of the OS/400 licensed program.

References:
None.

System i Support <http://www.ibm.com/systems/support/i>


IBM disclaims all warranties, whether express or implied, including, but
not limited to, the implied warranties of merchantability and fitness
for a particular purpose. By furnishing this document, IBM grants no
licenses to any related patents or copyrights. Copyright (c)
1996,1997,1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009 IBM Corporation. Any trademarks and product or brand names
referenced in this document are the property of their respective owners.
Consult the Terms of use link for trademark information.



Copyright and trademark information



IBM, the IBM logo and ibm.com are trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other
product and service names might be trademarks of IBM or other companies.
A current list of IBM trademarks is available on the Web at "Copyright
and trademark information" at www.ibm.com/legal/copytrade.shtml.










--------------------------------------------------------------------------
Scott Schollenberger
Vice President, Research & Development

P: 610-239-9988 x305
F: 610-239-9995
E: sschollenberger@xxxxxxxxxxxxxxxxxx
http://www.harriscomputer.com/
100-2011 Renaissance Blvd.
King of Prussia, PA
19406
http://www.harris-schoolsolutions.com

This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.