Read operation on a subfile

0 pts.
Tags:
Programming Languages
RPG
Hi, Can we use the READ opcode on a subfile as we do on a database file? thanks
ASKED: June 15, 2005  6:37 AM
UPDATED: June 16, 2005  8:06 AM

Answer Wiki

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

Yep Read READC or chain

keep in mind chain is by relative record#

Ken

Discuss This Question: 4  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
  • MadDogDing
    Keep in mind, though, that when you do the READC, it will only read in records from the subfile that have had a CHANGE made to them. As an example, if you have written a bunch of subfile records out and have a one-byte input field at the front and the user inputs a "1" (to select the record) into the input field on the third record of the subfile, then, when you do a loop to perform the READC, the only record that you will get will be the third record. If the user had entered a "1" on the third and the fifth subfile record, then the looping READC would first read subfile record 3 and the next READC would give you subfile record 5.
    0 pointsBadges:
    report
  • TheQuigs
    MadDogDing is correct. Just remember that if the user uses the field-exit key to get to the 3rd and 5th records, they have changed -- even pressing space to move through subfile records flags them as changed.
    0 pointsBadges:
    report
  • Cyates
    If you need to read all the records, even if they weren't changed, you can use the SFLNXTCHG keyword when loading the subfile.
    0 pointsBadges:
    report
  • AS400programmer
    remember sflnxtchg is indicator driven. so you can control wahat records come back. I usually use a one byte hidden field to indicate that the user has changed are added something to a sfl record. I continue to bring that record back while that sfl is on the display. Say a sfl is 200 records and the user touches only 6 of those records, It's better to bring back the 6 they touched than all 200.
    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