Record updation through RPG

5 pts.
Tags:
AS/400
RPG
While I'm updating a particular field of a record through RPG is it gonna update the entire record (remaining fields with their previous values) or only the field which we want to update? If yes, why? No, why?

Software/Hardware used:
as400

Answer Wiki

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

If you just update the record the whole record will be updated, not just the field you want.  

 
There are ways to insure only the field you want is updated.
Make certain that the other fields in the record are not changed in the logic when the same field is in anothger record.
Except output can specify the field you want to update. 
In RPGFREE the field to update can be specified on the update verb.

This BIF available after V5R2.

     // Update only the Balance and AccTyp fields
     Update ACCMR %Fields(Balance : AccTyp);
If you are not familar with thes metyhods check the RPG books available.
Good Luck!
PGMBOB

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
  • philpl1jb
    Though RPG .. RPG/400 (RPG/III) or RPGLE - RPG/IV
    51,355 pointsBadges:
    report
  • ToddN2000
    The old way on earlier releases was to do it by exception output. In your output specs you would list the file with an exception name and only those fields you wished to update. It depends on what release you are on as to which solution will work for you. Most likely you can use the method in the answer using the BIF.
    15,605 pointsBadges:
    report
  • philpl1jb
    Thanks Todd.  I was hoping that the person who asked the question would respond.
    51,355 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