How to create a Data Area with RPG for storing variables

pts.
Tags:
Data Area
RPG
RPG variables
How to create a data area using an RPG.I need to create a data area and store some values in it.The value to be stored are also retrieved from the same RPG.(that is from screen variables)

Answer Wiki

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

If you do want to use a data area, this is how in RPG:
1. Define in D-SPECS

<b>D wkEndDate S 32A DTAARA</b>

2. Bring in data area and lock in this case.

<b>in *lock *dtaara</b>;

3. Update it like any other variable.

<b>wkEndDate = 2008-02-02</b>

4. Write out data area and release when finished

<b>out wkEndDate;</b>

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
  • hey Phil My idea was to retrieve a few screen variables and write it to a dataarea which will be used by another cl. I have managed to do the same by declaring a dataarea datastructure in I spec. Then used *LOCK,MOVE,OUT opcodes.
    0 pointsBadges:
    report
  • philpl1jb
    And the second CL isn't called by the first .. or by the same parent CL? If they are tied together you could pass the values as parameters. Are you OK or do you need something more?
    50,205 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