× 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.



Hi, Tom:

_How about this:_
Assuming the customer has CRTBNDRPG (ILE RPG IV) installed, you could generate a small RPG IV program with "in-line" data at the end, you know, where you declare an array, and then, at the end of the source, you have two asterisks, followed by the in-stream data. Then, you compile this program on the customer box to create the "encapsulated" version. You call the program and it can return the data to the caller, using the parameters. The exact "API" design is left up to the reader (how many parameters, what kind, etc.) and may depend in part on what kind of data you need to store and retrieve. If you ever need to change this data, you just regenerate the RPG IV source and recompile it with CRTBNDRPG, and "Voila!" (And of course, you would generate this source in QTEMP and compile from there.)

If the customer does not have RPG IV, you could do something similar in ILE COBOL or ILE C/400, assuming they have one of those compilers installed.
In fact, even if none of those compilers are installed, you could do something similar in ILE CL (CLLE), using CRTBNDCL; here is a very simple small example:

PGM PARM(&REQUEST &RESULT)
DCL &REQUEST *CHAR 10
DCL &RESULT *CHAR 10
DCL &SERIAL *CHAR 10 VALUE('1020828')
DCL &MODEL *CHAR 10 VALUE('170')
DCL &FEATURE *CHAR 10 VALUE('2290')
DCL &PROCGRP *CHAR 10 VALUE('P05')
IF (&REQUEST = 'SERIAL #') THEN(CHGVAR VAR(&RESULT) VALUE(&SERIAL))
IF (&REQUEST = 'MODEL #') THEN(CHGVAR VAR(&RESULT) VALUE(&MODEL))
IF (&REQUEST = 'FEATURE') THEN(CHGVAR VAR(&RESULT) VALUE(&FEATURE))
IF (&REQUEST = 'PROC.GRP.') THEN(CHGVAR VAR(&RESULT) VALUE(&PROCGRP))
RETURN
ENDPGM

You could even issue CRTCLMOD to create a *MODULE, and then re-bind it into some other ILE *PGM or *SRVPGM, using UPDPGM or UPDSRVPGM, thus replacing the previous version of that *MODULE within that bound ILE *PGM or *SRVPGM.

That gives you essentially the capabilities you asked for (the ability to store any information you want within the actual confines of some ILE *PGM or *SRVPGM object). using only documented and supported interfaces.

Would that "work" for you? ;-)

Be creative. Have fun! :-)

All the best,

Mark S. Waterbury

> Tom Liotta wrote:
Mark S. Waterbury wrote:

You could use CRTCLPGM to create OPM CLP programs for this purpose, as this feature is "bundled" with the "base" OS. Or, write those programs in MI assembler language; the QPRCRTPG API is also built-in to the "base" OS. Are you concerned about future availability of the other ("heritage") OPM compilers?

Mark:

OPM CL is off limits, so far -- it isn't created through the QPRCRTPG API (and results in CPF0304 when tried; I've prodded in various ways.) OPM MI is through QPRCRTPG, though, and is one of the potential solutions. But that really seems appropriate for limited circumstances. MI programs aren't things that I knock out in a hurry.

The separate licensing of OPM and ILE compilers is where the question came up.

The whole problem is mostly just an example to illustrate how associated spaces might be used -- to store info essentially encapsulated in a *PGM object that can be changed, saved and restored. It's an example difference between OPM and ILE compiled programs, and separate licenses are needed to get the feature.

It's a feature that I've used for some handy effects. If ILE doesn't have equivalent capability hidden somewhere, I'll figure a way around it to get similar effects.

But you never know what people on this list have discovered if you don't ask. There just might be an obscure feature that can be used.

Tom Liotta


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.