Scott, it should work to use the UDS so long as you also use the keyword
DTAARA(*LDA).  The line below is copied straight from the manual.
Then you can lock and unlock the data area at will.
Booth Martin
-------Original Message-------
From: RPG programming on the AS400 / iSeries
Date: Wednesday, July 02, 2003 12:06:26 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Can you use UDS but NOT lock the data area?
On Tue, 1 Jul 2003, Michael Gottlieb wrote:
> It seems when I use "UDS" to define a data area to my program, the data
> area is locked for the duration of the program. Is there a way to
> prevent this? I still want to use UDS but not lock the data area.
When you define a data area using UDS, the RPG program will read it
automatically when the program starts, lock it, and update/unlock it
only when the program ends. That's what UDS is for.
If you want to read a data area without doing that, use the IN & OUT
RPG op-codes instead of UDS.
Here's an example of that:
D RptDate 1 8A
D RptType 105 106A
D LastRun 1 8A
D LastRptType 105 106A
** Load the LDA. This does not lock it.
c in LDA
c dsply RptDate
c dsply RptType
** Load My Data Area. This does not lock it.
c in MyDtaAra
c dsply LastRun
c dsply LastRptType
** Load My Data Area again, this time lock it and update it.
c *lock in MyDtaAra
c eval LastRun = RptDate
c eval LastRptType = RptType
c out MyDtaAra
c eval *inlr = *on

Return to Archive home page | Return to MIDRANGE.COM home page