Hi Everybody … this is my first attempt to use this resource. I think I have a good question and would welcome advice.

pts.
Tags:
RPG
Language: AS400/RPGLE (RPG IV) Area: Data Structures over a physical file I have created some work data structures to store field data in during a work-in-process user session. I want to: 1) CHAIN to a specific record in a physical file 2) Move data from the record to the working data structure using only one command: MOVEA (record data struc) (work data struc) ----- Problem: I'm cannot seem to successfully create a data structure over an item file in the "D" specifications area and use the MOVEA opcode to move data in one shot to the work data structures. I've researched the AS400 manuals and the Cozzi book without success. Can anyone help??? Thanks for your time on this. Marius

Answer Wiki

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

Dude, you are using wrong op code. Here is some pseudo code:
F ItemFile

D fileds E DS EXTNAME(itemfile)
D workds E DS EXTNAME(itemfile) prefix(z:1)

C keylist chain itemfile
C if %found(itemfile)
C eval workds = fileds
C endif

Now all fields are available and if you need to update, then EVAL FILEDS = WORKDS and do an update. MOVEA is for arrays, not data structures. Try Bob Cozzi’s group for basic code stuff like this. Or even Google would pulled it probably.

Discuss This Question: 1  Reply

 
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
  • Teamsi
    You can also try to use LIKEREC data structures and perform I/O directly into these data structures in one statement. The fields are referenced as Qualified.Names (which allows for better documentation as to where the fields are coming from - this can be useful as programs are becoming ever the more complex) FCUSTFILE IF E K DISK D custRecDs ds likerec(custRec) /free // Read the record directly into the data structure chain (?abc? : ?AB?) custRec custRecDs; // Use the data structure fields if (custRecDs.code = *BLANKS); custRecDs.code = 'X'; update custRec custRecDs; endif;
    0 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