× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



How is your data in savkey? The save fields may not be unique enough.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of derek gonsalves
Sent: Wednesday, October 11, 2006 8:14 AM
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



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.