|
Can you post the DDS for the display file too? What is the value of the field defined in the DDS with the SFLRCDNBR keyword? If the value of this field doesn't match a RRN for the subfile then you'll get the I/O error you describe. You would also get that error if the subfile was empty and SFLDSP is set. Jonathan -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of derek gonsalves Sent: 11 October 2006 13:14 To: RPG400-L@xxxxxxxxxxxx Subject: single page subfile- position to problem... hii evrbody... i have an issue with the single page subfile loading.. the page- up and page-dwn functions are working fine.. bu when i enter a value in the position to field the subfile gets loaded from that value onwards .. but if i do a pageup(rolldown) then the program crashes. gives me an error as --- Permanent input output error occured in the display file i tried debugging .. and the values are being written into the subfile record format .. but during the Exfmt of the subfile control .. the program crashes... my rpg code has been written on the same lines as follows.... except for changes in field names and file names.. but i have followed the same structure and logic. (this reference code was obtained from Midrange Programmer - Back to basics) Any help will be appreciated .... Thanx nd Regards Derek *================================================================ * * To compile: * * CRTRPGPGM PGM(XXX/PAGEATATIMERG) SRCFILE(XXX/QRPGLESRC) * * rpgle program for single page subfile * *======================================================================= Fsfl003df cf e workstn F sfile(sfl1:rrn1) F infds(info) Fsfl001lf if e k disk Dinfo ds D cfkey 369 369 Dsvlnam S like(dblnam) Dsvfnam S like(dbfnam) Dexit C const(X'33') Dcancel C const(X'3C') Denter C const(X'F1') Drollup C const(X'F5') Drolldn C const(X'F4') Dsflpag C const(15) Dsflpag_plus_1 C const(16) * ***************************************************************** * Main Routine ***************************************************************** * * Clear then build the initial subfile * C exsr clrsfl C exsr sflbld * * Do loop to process the subfile until F3 or F12 is pressed * C dou (cfkey = exit) or (cfkey = cancel) * C write fkey1 C exfmt sf1ctl * * Process position to information entered by the user, then clear * and rebuild the subfile. Lastly, clear the position to field * C select C when (cfkey = enter) and (ptname <> *blanks) C ptname setll sfl001lf C exsr clrsfl C exsr sflbld C clear ptname * * Clear and rebuild the subfile when user pages down (rolls up) * C when (cfkey = rollup) and (not *in90) C exsr clrsfl C exsr sflbld * * Position data file to one page before current subfile data, then * clear and rebuild the subfile to show that previous page * C when (cfkey = rolldn) and (not *in32) C exsr goback C exsr clrsfl C exsr sflbld C endsl C enddo C eval *inlr = *on * ***************************************************************** * CLRSFL - Clear the subfile ***************************************************************** * C clrsfl begsr * * Clear relative record numbers and subfile * C eval rrn1 = *zero C eval *in31 = *on C write sf1ctl C eval *in31 = *off C eval *in32 = *off C endsr * ***************************************************************** * SFLBLD - Build the List ***************************************************************** * C sflbld begsr * * Load the subfile with one page of data or until end-of-file * C do sflpag C read sfl001lf 90 C if *in90 C leave C endif C eval rrn1 = rrn1 + 1 C write sfl1 * * save first record data * C if rrn1 = 1 C eval svlnam = dblnam C eval svfnam = dbfnam C endif C enddo * * If no records added to subfile, do not display it * C if rrn1 = *zero C eval *in32 = *on C endif * C endsr * ***************************************************************** * GOBACK - page backward one page ***************************************************************** * C goback begsr * * Position data file to first record of subfile * C savkey setll sfl001lf * * Re-position pointer in file for rolling backward. If beginning * of file hit before done, set pointer to first record of data file. * C do sflpag_plus_1 C readp sfl001lf C if %eof C *loval setll sfl001lf C leave C endif C enddo * C endsr * ***************************************************************** * KEYLISTS ***************************************************************** * C savkey klist C kfld svlnam C kfld svfnam -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.