Can anyone give me solution? I need to read from data area to a data
structure within subprocedure. I want to use:
*Dtaara Define <dataarea name> <data structure name>
in Calculation spec. to read the dataarea data but the IBM ILE RPG Language
Reference said that
*Dtaara Define cannot be used within subprocedure. If *Dtaara Define
cannot be used within subprocedure, what can I use within subprocedure in
which I can read data from dataarea to data structure? Thanks for your
time and help.
Thomas
--
|> Jim D. Barnes,CCP,
|> Certified AS/400 Technical Specialist V4R3,
|> Certified AS/400 RPG Programmer
|> Enjoys Life with:
|> The 400 School - a division of PowerTech Toolworks
|> The Right Choice for Your AS/400 Training Needs
|> Ask about our Expert Consultants
|> Dallas Office: 972-317-7759 Fax: 972-317-0609
|> Email: jba...@400School.com
|> Corporate Office: 888-282-9065
|> Training & Education: www.400school.com
|> Consulting Services: www.toolnet.com
Thomas wrote in message ...
Thomas, define the data area in the main source section (the part of the code
before the subprocedures), either in the D specs (DTAARA keyword) or the C
specs (*DTAARA DEFINE). You can do this even if you have a NOMAIN module.
Barbara Morris IBM Toronto Lab RPG Compiler Development
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
You can declare the data area outside of the subprocedure, and then access it
from within the subprocedure. This may not give you the level of encapsulation
you really want, but should get around your problem.
Consider the following which can be compiled as a module (could be placed in a
*SRVPGM or bound directly into another, or you could include such source
directly in your main program):
H nomain
DGETSEQ pr 6p 0
D DATA1 s 6p 0 dtaara
P GETSEQ b export
D pi 6p 0
C *lock in DATA1
C add 1 DATA1
C out DATA1
C return DATA1
P e
-Ian.
Thomas wrote:
> Hi!
>
> Can anyone give me solution? I need to read from data area to a data
> structure within subprocedure. I want to use:
>
> *Dtaara Define <dataarea name> <data structure name>
>
> in Calculation spec. to read the dataarea data but the IBM ILE RPG Language
> Reference said that
> *Dtaara Define cannot be used within subprocedure. If *Dtaara Define
> cannot be used within subprocedure, what can I use within subprocedure in
> which I can read data from dataarea to data structure? Thanks for your
> time and help.
>
> Thomas
--
Ian Stewart
i...@incognito.co.nz
Thomas wrote:
Hi!Can anyone give me solution? I need to read from data area to a data
structure within subprocedure. I want to use:*Dtaara Define <dataarea name> <data structure name>
The first the field in Result field area do not mean <data structure name> but program name of the dataarea. You can write:
*Dtaara Define <Result field name>and <Result field name> have to be same as the dataarea name and same as <data structure name>.
D DS_NAME UDS DTAARA(DTAARA_NAME) D Field1 ... D Field20or
D DTAARA_NAME UDS DTAARA D Field1 ... D Field20To operate with data from *DTAARA object and move it into (from) DS you have to use IN or OUT oparation code. For example:
*LOCK IN <Name>or
*LOCK OUT <Name>or
OUT <Name>You can use this op-codes (IN, OUT) into any subprocedures. Of course you can define your dataarea in subprocedure as DS with DTAARA keyword.
in Calculation spec. to read the dataarea data but the IBM ILE RPG Language
Reference said that
*Dtaara Define cannot be used within subprocedure. If *Dtaara Define
cannot be used within subprocedure, what can I use within subprocedure in
which I can read data from dataarea to data structure? Thanks for your--
time and help.Thomas
Bob Utyushev
Project Manager
AServer Ltd. (IBM Authorized Training Partner)
mailto:bo...@cityline.ru --- ICQ #2507552, nickname: Whisper