Access DataArea which is not in my *LIBL

510 pts.
Tags:
AS/400 Library
Data Area
Library List
RPG III
How can I access a data area from a different library without change my library list in RPG III

Software/Hardware used:
AS400
ASKED: January 6, 2011  3:42 AM
UPDATED: January 7, 2011  1:29 AM

Answer Wiki

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

Since no override option is available with dtaara’s (to my knowledge..!), you may solve this challenge by using the RTVDTAARA command.
Create a CL-pgm (which you may call from your RPG-pgm) with a parameter to return the data from your dtaara, and in this CL-pgm you can use the RTVDTAARA command with the RTNVAR parameter.
<pre>
RTVDTAARA DTAARA(MYLIB/MYDTAARA *ALL) RTNVAR(&RTNVAR)
</pre>
Good Luck
DanF

Discuss This Question: 2  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
  • TomLiotta
    First answer probably should be to convert away from RPG III to use RPG IV. Then it's easy to handle. My latest RPG III (RPG/400) manual is from 1994, and the language hasn't changed much since then. Other than DanF's suggestion, I suppose you could CALL QCMDEXC to add the other library to your library list; but you'd want to be careful with data area names that might be the same in different libraries. It seems to me that the least effort is simply to convert to RPG IV and run in compatibility mode. Tom
    125,585 pointsBadges:
    report
  • MurrayInfoSys
    22917 - I've had this problem before. Way back in RPG III mode. We created two CL's - LDAIN, LDAOUT. (Get it? LDA OP codes!) LDAIN - read in the DtaAra to a file in QTemp which the program used. LDAOUT - Took the *LDA from the program that used the DtaAra file and updates the prescribed DtaAra. Parms are the Library and DtaAra. The DtaAra is assumed to be 1024 in length. Phil
    940 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