Subfiles

pts.
Tags:
Application development
AS/400
RPG
I am writing a RPG program using Subfiles for the first time. My program calls okay but my subfile is doing something strange. When i call the program, it dispalys the subfile starting from the last page of the subfile, what i need to do is display the subfile from the first record it finds. Can someone help me please thank you

Answer Wiki

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

Before your exfmt command set your relative record number to 1.

Discuss This Question: 6  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
  • Fabrics
    If you are using the keyword sflrcdnbr on your subfile you need to make sure that it has a value of 1. This parameter tells the subfile which record to have on the display.
    0 pointsBadges:
    report
  • Rafiqm
    r u going for load all page or expand page method. if its expand page method u must move the rrn varible to a variable. There may be some problem with the relative record number. check out the rrn value before exfmt through debugger. i.e. thru strdbg!!!!
    0 pointsBadges:
    report
  • DawerKhan
    Set the RRN to 1 in your RPG program, before display the subfile. Hope it helps.
    0 pointsBadges:
    report
  • JokerNZ
    Within the SFLCTL record you code a hidden field to contain the RRN that you wish the SFL page to be positioned to. This field is loaded within your program. A HRRN$ R H SFLRCDNBR(CURSOR) If the user scrolls through a number of pages and hits enter the subfile will be positioned to whatever is in HRRM$ and not where they currently are. This is known as the subfile roller coaster effect. Code a file information datastructure on your program display file F specs and use the current subfile record to load into HRRN$ to position the page to where it currently is. FUN258 CF E WORKSTN INFDS(INFDS$) F Sfile(SFLRCD:#Sfrrn) D INFDS$ E DS D #Workstn *File D #Record *Record D CSRLOC 370 371B 0
    0 pointsBadges:
    report
  • JohnAllen
    Look in the example below: If H$RRN1 = 50 the subfile will display the subfil;e page that contains the 50th subfile entry If H$RRN1 = 1 the subfile will display the page that contains subfile record 1 0007.20 A HLPEXCLD 0007.30 A HLPARA(*NONE) 0007.40 A H$RRN1 R H REFFLD(RRN) 0007.50 A SFLRCDNBR(CURSOR) 0007.60 A 1 2DATE 0007.70 A EDTCDE(Y)
    0 pointsBadges:
    report
  • TomLiotta
    It can depend on what your subfile definition looks like and how your program populates it. Since you didn't show us either one, it's a guess. A likely guess is what others have written. You've code a load-all (or expanding) subfile and you're telling the system to display the last page. That's done by using the SFLRCDNBR keyword and placing a record number into it that matches with the last page. Your best action is probably to remove the SFLRCDNBR keyword from the DDS and recompile. You don't seem to have a use for it. You're better off removing it than trying to manipulate its value when you don't need it. That's not the only way to get the behavior you describe; it's just much more likely than alternatives. Without seeing the DDS and program code, it's as close as anyone can get. Tom
    125,585 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