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



Kurt,

You're right. Of course I am. Silly me.

I just tried is specifying

out(e) *lock ExtraParm

and the data area remains locked throughout the entire process. The called
program crashes because it can't obtain a lock.

So in order for this process to simulate a CONST parameter, I'd simply have
to save the 'parameter' value, do an OUT (without a *LOCK) and then, when
control is returned, use the saved value rather than the data area value
(since one of the called programs might have changed it.

So I create a new program TEST1 as follows:

D ExtraParm UDS 32 Dtaara(EXTRAPARM)
/free

ExtraParm = *all'abc';
dsply ExtraParm;
return;

begsr *pssr;
return;
endsr;

/end-free

If I call TEST1 and return without setting on *INLR, the data area remains
locked (as I would expect, given the RPG manual). However, if I then
manually change EXTRAPARM call TEST1 again (with EXTRAPARM already locked),
TEST1 doesn't crash, but EXTRAPARM isn't automatically read in either. So
there seems to be an inconsistency somewhere, since this behavior (defining
a data area as a UDS and then calling the program when the data area is
already locked) *did* result in an error in the called program when the data
area was still locked by the caller.

Plus there's some optimization going on because if I call the TEST1 once
(leaving EXTRAPARM locked) and then delete EXTRAPARM, then when I call TEST1
again, it doesn't create EXTRAPARM automatically.

Perhaps I'm just worrying too much....

Rory

On Tue, Jan 13, 2009 at 12:45 PM, Kurt Anderson <
kurt.anderson@xxxxxxxxxxxxxx> wrote:

Rory, you're performing an OUT prior to the call, which is unlocking the
data area. Check this out:
"You can specify the optional reserved word *LOCK. When *LOCK is
specified, the data area remains locked after it is updated. When *LOCK
is not specified, the data area is unlocked after it is updated."

However I'm not so sure the called program can access that locked data
area.

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.