how to pass DATA AREA to RPGLE PROGRAM

695 pts.
Tags:
CL
RPGLE
hi, I have one data area called ABC of type *CHAR length is 10 in that i have some data i want pass that data area to RPGLE program as parameter, with in RPGLE program how can i receive that data area values in my program as PLIST and i am just calling this program from command line not from CL PROGRAM can any one help me regarding this

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

You need to define your data area in your program and retrieve the data from it directly, you don’t need to use the PLIST or PARM statements.

Here’s a link on how to define and use data areas in RPGLE.

Regards,

Martin Gilbert.

———————————-

That’s right Data Areas are accessible to all programs, therefore you don’t have to pass them as a parameter. You just have to define in your Data Specification and access it with the operation code IN. Formerly the definition was done through an operation code <b>DEFINE</b> and <b>*DTAARA</b> keyword in factor one.

Example:

<pre>* The result field entry (TOTNET) is the name of the data area to
* be used within the ILE RPG program. The factor 2 entry (TOTAL)
* is the name of the data area as defined to the system.
C
C *DTAARA DEFINE TOTAL TOTNET</pre>

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gilly400
    Hi, Slight amendment to above statement :- Data Areas are accessible to all programs Should read Data Areas in your library list are accessible to all programs Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Sloopy
    It sounds as if you want to use the contents of the data area when you call the program from the command line, and you don't want to write a CL program, and you don't want to declare the data area in your program. Well, there are only two ways to do that. First is to look at the data area, see what the value is, and use that value in the parameter list. Second is to change your mind and write a CL program or declare the data area in your program. You CAN access a data area which is not in your library list, by using the RTVDTAARA CL command. You can only use this in a CL program. Is there some specific reason why you don't want to use a CL program or declare the data area in the RPG code? If so, please let us know. It won't make any difference to the answers, though. Regards, Sloopy
    2,195 pointsBadges:
    report
  • TomLiotta
    Data Areas in your library list are accessible to all programs You CAN access a data area which is not in your library list, by using the RTVDTAARA CL command. RPG has allowed reference to data areas through variable names since V5R3. The variable may have the name in the form 'LIBRARY/DTAANAME'. That is, it does not have to be in your library list and you don't need to use RTVDTAARA. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following