PageDown and PageUp functions in SFL subfile

2,300 pts.
Tags:
AS/400
SFL subfile
Subfile
How to manage the PageDown and PageUp function in SFLSIZ=SFLPAG subfile..? If anybody have the sample codes for this please share it... Thanks.
ASKED: November 21, 2011  7:47 AM
UPDATED: August 26, 2013  3:52 PM

Answer Wiki

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

In Control format of Subfile, define pagedown along with other Function Keys. Map the PAGEDOWN with any available Indicator(Eg:- 41)
<pre>…..AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++++
A CF12(12 ‘PREVIOUS’)
A N40 PAGEDOWN(41 ‘PAGEDOWN’) </pre>

We must be handling PageDown Operation in our program using Indicator ’41′. Indicator ’40′ indicates End Of Subfile.

In Case of SFLPAG = SFLSIZ subfile,
In every attempt we will be loading only ‘SFLPAG’ number of records at a time.
When Page down is Pressed, The consequent records(equal to SFLPAG) will be loaded into Subfile.
At the End of the Subfile we will need to Switch ON Indicator ’40′.
The Sample code will be like below.
<b>Subfile Load Routine</b>
<pre>
/Free
Read TESTPF
Dow RecCnt <= SflPagCnt ;
//Write Records to Subfile
RecCnt = RecCnt + 1 ;
Read TESTPF ;
EndDo ;
If %EOF(TESTPF) ;
*In40 = *On ; //End of SubFile
EndIF ;
/End-Free
</pre>

Call this routine when ever Page Down is pressed.

<pre>
If *In41 = *On
LoadSfl() ;
EndIf ;
</pre>

Pradeep.

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
  • philpl1jb
    Pradeep. Problems with your page down routing Becuase sflsiz = sufpag this is a page-at-a-time routine 1. Must clear the Sfl 2. Should set RecCnt to 0 at beginning of routine. 3. Shoud test for EOF of TESTPF 4. if you are putting 5 records in the subfile this code reads 6 (to set the MORE indicator) loading rows 1-5 but the next page down loads rows 7-11 and row 6 is never loaded! Phil
    48,565 pointsBadges:
    report
  • TomLiotta
    The ILE RPG Programmer's Guide includes a fairly complete example of a SFLSIZ=SFLPAG subfile application. Tom
    125,585 pointsBadges:
    report
  • deepu9321
    Hi Phil, thanks for correcting the errors. i was thinking to give a brief idea of how to load a page-at-a-time and missed the mentioned things. 1. Clear Routine should be called before loading the Routine and RecCnt must be intitalized. 2. Dow must be having condition for EOF. But, I didnt get you exactly, Why the Record '6' will get missed. In my example, If we are loading 6 records per page, am loading the subfile until RecCnt will become '6' and writing all the 6 records. We are not increasing Record Count for Switching ON the indicator for displaying 'More'. When ever EOF file occurs, then 'More' will not appear on the screen. Pradeep.
    3,605 pointsBadges:
    report
  • philpl1jb
    If you are loading reading and loading 6 you will not have the MORE indicator set right. But your logic gets the indicator correct. You have an initial read record 1 0 < 6 write 1 read 2 1<6 write 2 read 3 2<6 write 3 read 4 3<6 wirte 4 read 5 4< 6 write 5 read 6 5 < 6 wrote 6 read 7 end set more indicator ----------------- Actually your routine runs the first set fine but when the page down key is pressed it starts with a read 8 0<6 write 8 <-- row 7 was never written solution the primary or priming read should only occur when loading the first page so it's placed in the initial code before calling the routine. PgDn inicator doesn't read a record, it runs the routine which now starts with the do and write. Page up key .. a bit heaver code. Phil
    48,565 pointsBadges:
    report
  • philpl1jb
    And we still haven't addressed the pageup!!! Phil
    48,565 pointsBadges:
    report
  • Yorkshireman
    Lots of explanations and examples in the manuals and lots of chunks of code on the 'net that you can modify, Google is your friend... .
    5,520 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