|
Passing a teraspace pointer should be fine, as you describe.
Look at chapter 4 of the ILE Concepts book, esp. the rules for binding modules.
HTH Vern
At 12:08 PM 5/29/2005, you wrote:
I found the following under "Interlanguage Calling Considerations" in the information center at
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/books/c092507415.htm
4. Using ILE C and other languages, you can declare pointers to teraspace memory. ILE C requires a special compile-time option to address this type of storage, but ILE RPG can always address this storage if compiled with a target release of V4R4M0 or later. For more information on pointers in teraspace, see the ILE Concepts, SC41-5606-06 publication.
This seems to indicate that RPG IV V4R4 and later is, by default, terraspace enabled. I have used teraspace pointers and storage myself in RPG IV modules by prototyping and calling the C teraspace storage functions _C_TS_malloc, _C_TS_realloc, and _C_TS_free.
I use these functions in RPG IV subprocedures in the service program that drives my CGI programming tool kit, CGIDEV2 available at no charge from IBM at http://www-922.ibm.com/.
I didn't have to do anything special at either module creation time or service program creation time.
If Zvi's RPG program is passing a pointer parameter to the the C program, and the C program expects that pointer to be a teraspace pointer, it's possible that allocating that pointer in the RPG program with _C_TS_malloc will solve the problem.
Mel Rothman Mel Rothman, Inc.
Vernon Hamberg wrote:Zvi
I dug around some, especially in the ILE Concepts manual. Chapter 4 of that manual discusses teraspace usage. A module has to be both enabled for teraspace AND use the *TERASPACE storage model. Only C and C++ have the option to specify the storage model on the module create command. At least, this is what I am seeing. I find it interesting that the RPG Reference says a new capability at V4R4 is the "ability to tolerate pointers in teraspace".
So I think that there is no way to create an RPGLE module that will use the teraspace storage model, hence, you cannot bind any RPGLE module to a C module that IS using that storage model. Use the DSPMOD command to see the 2 values
Teraspace storage enabled . . . . . . . . . . . . . . : *YES
Storage model . . . . . . . . . . . . . . . . . . . . : *SNGLVL
So I believe you can call an ILE RPG program from a C program and pass a teraspace pointer. You might even be able to declare such a pointer in RPG - I don't know that answer.
You might post to the RPG group here - someone there will probably know more. And your company should have IBM support - if so, you can call and get your question answered - someone at your company might need to authorize you, or they can call for you. The point is, IBM support will take the time to answer your question. And your company has already paid for it. I cannot suggest strongly enough that the best source is ultimately IBM itself - we on this list have limited knowledge compared to what you get at IBM, although the list often responds more quickly when someone knows the answer. OTOH, you can put your question out on the Internet interface at IBM and get the answer pretty quickly, without waiting on the phone.
Let us know what you find.
Vern
At 03:04 AM 5/29/2005, you wrote:
Vernon,
If I create RPGLE module by CRTRPGMOD in V5R3 or V5R2: CRTRPGMOD MODULE(SV/TVUEP) SRCMBR(TVUEP) (Note: CRTPGMOD has no STGMDL parameter.)
and then CRTPGM PGM(SV/TVUEP) MODULE(SV/TVUEP) STGMDL(*TERASPACE) then I got an error message: Module has incompatible storage model. Program TVUEP not created. Can you help?
Zvi
Vernon Hamberg <vhamberg@xxxxxxxxxxx> wrote: The storage model is on the CRTPGM command and nowhere else that I know of. You create modules, then link them using CRTPGM. Even when there is only one module.
The CRTBNDxxx commands are meant to work like the OPM CRTxxxPGM commands, so I would expect them to assume the original single level storage model. And I would not expect the ability to change storage model on a compiled object.
HTH Vern
At 06:53 AM 5/26/2005, you wrote:
>I call a Teraspace ILE C program from RPGLE in V5R3.
>As declared in ILE Concepts, RPGLE is Teraspace enabled by default from V4R4.
>
>But I got an error:
>
>Space address is not a teraspace storage address
>
>Application error. MCH0609 unmonitored by TVQSC at statement *N,
>
> instruction X'0000'.
>
>RPG status 00202 caused procedure TVUEP in program SMZV/TVUEP to stop.
>
>Application error. RNX9001 unmonitored by TVUEP at statement *N,
> instruction X'0000'.
>
>
>DSPPGM SMZV/TVUEP shows:
>
>
>
>Teraspace storage enabled PEP . . . . . . . . : *YES
>
>Teraspace storage enabled modules . . . . . . : *ALL
>
>Storage model . . . . . . . . . . . . . . . . : *SNGLVL
>
>
>
>But there is no STGMDL(Storage Model) option in command CHGPGM,
>
>Or commands CRTRPGMOD, CRTRPGPGM, CRTBNDRPG.
>
>
>
>Regards,
>
>
>
>Zvi
-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.