APIs by Example: Tricky Retrieve APIs and How to Process the Receiver Variable

Most retrieve APIs are simple to work with. The data returned is defined by a data structure, and the information provided is in character or integer format. While often more than one alternative or accumulating return format is available, each is simple in structure and straightforward to process. As an example of an API providing alternative return formats, see the Retrieve Job Information (QUSRJOBI) API, which offers 12 different return formats. As an example of accumulating return formats, see the Retrieve Member Description (QUSRMBRD) API, which offers three return formats, the second including the first format, and the third including the second format.

Today, I discuss a couple of return formats that are a bit more challenging to handle. To help me do that, I’ve created a Display System Configuration (DSPSYSCFG) command involving the use of many different retrieve APIs—some of which demonstrate the simple approach of returning data, others a variety of the more challenging methods. This article’s focus is on the latter retrieve API type and also includes a couple of MI built-ins. In MI built-in terminology, retrieve functionality is referred to as materialize, and sometimes, when no adequate retrieve API is available, there’s a materialize MI built-in that will fit the bill nicely. More about that in a minute.

The Retrieve System Values (QWCRSVAL) and Retrieve Network Attributes (QWCRNETA) APIs resemble each other in the way that the return data is requested and how it is returned.

Download the save file containing the source code.

Read the entire article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s