|
Hi Michel,
When using a dataarea defined with "UDS", you don't use the IN/OUT
op-codes. Instead, it reads the data area when the program loads, and
writes it out when the program ends.
the IN/OUT op-codes are intended to be used with data areas defined using
*DTAARA DEFINE or the DTAARA keyword (on your D-specs).
Here's an example of how I'd use IN/OUT to make your program work:
Program 'LDA1':
D LDA DS DTAARA(*LDA)
D Entity 1020 1024
c IN LDA
c move '10203' Entity
c out LDA
c call 'LDA2'
c IN LDA
c dsply Entity
c eval *inlr = *on
Program 'LDA2':
c call 'LDA3'
c eval *inlr = *on
Program 'LDA3':
D LDA DS DTAARA(*LDA)
D Entity 1020 1024S 0
c IN LDA
c add 1 Entity
c out LDA
c eval *inlr = *on
Note that at the end, the DSPLY in 'LDA1' will print '10204', which
shows that LDA3 is seeing the '10203' and LDA1 is seeing that LDA3
added 1 to it.
Hope this helps....
On Wed, 11 Apr 2001 michel.cuypers@newwave.be wrote:
>
> Hi, Y'All,
>
> I think I must elaborate a bit on the processing codes & - circumstances
>
> 1. First of all, all pgms are interactive.
> 2. To code the *LDA I use following instructions.
>
> In pgm 1, I use
> 138.00 D* LDA
> 139.00 D UDS
> 140.00 D ENTITY 1020 1024
> 141.00 C****************************************************
> ...
> 1015.00 C* FILL IN LDA
> 1016.00 C *LOCK IN *DTAARA
> 1017.00 C MOVEL $ENTY ENTITY
> 1018.00 C OUT *DTAARA
> 1019.00 C*
>
> In pgm 2, I don't use anything
>
> And in pgm 3, I use
>
> 0145.00 D* LDA
> 0146.00 D UDS
> 0147.00 D ENTITY 1020 1024
> 0148.00 C*********************************************
> ...
> 0568.00 C* NEW ENTITY
> 0569.00 C* ----------
> 0570.00 C* KEEP IN LDA
> 0571.00 C Z-ADD 0 $ENTY
> 0572.00 C *LOCK IN *DTAARA
> 0573.00 C MOVEL ENTITY $ENTY
> 0574.00 C ADD 1 $ENTY
> 0575.00 C MOVEL $ENTY ENTITY
> 0576.00 C OUT *DTAARA
>
> Pgm 3-coding seems to be working, since during toggling through pgms2-3 the
> ENTITY-value is incremented ...
>
> On the other hand, In pgm-1 $ENTY is calculated and supposedly put in *LDA:
> ENTITY
> to calculate & pick up the entity-value where it was left off (for instance,
>the
> day before)
> This calculation is OK (debugging) , but ...
>
> Greetings, Michel
> ___________________________________________________
>
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.