× 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.



Derek,

We had this problem with some applications where the user would copy a
block of text from Word and paste it into a description field.  The data
would be processed and written to the file but then when we tried to
redisplay it the invalid characters would crash the display file.  Our
solution was to scan the fields on input replacing any invalid character
(for us it was those below x'20), with a x'40' before writing it to the
file.  To clean the bad data out of the file we had to write a program
to go through all the records checking for the bad characters, replacing
them with a x'40'.  The code isn't very elegant but I will include it.

Scott Feddersen
The Buckle, Inc.

C* Remove control characters from product long description   
C                   CLEAR                   WK1500           
C                   MOVEL     DSP_PRODLD    WK1500           
C                   DO        1500          X                
C                   IF        WRK(X) <= x'20'                
C                   EVAL      WRK(X) = *BLANK                
C                   ENDIF                                    
C                   ENDDO                                    
C                   MOVEA     WRK           DSP_PRODLD       
C                   EVAL      PRD_PRODLD = %TRIM(DSP_PRODLD) 

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of derek gonsalves
Sent: Thursday, October 12, 2006 1:11 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: single page subfile- position to problem...


Hii everyone..

after going through the midrenge.com, i have realised that this problem 
(error) is occurring only for a particular set of data.. i.e. the error
does 
not occur for all cases of position to . only when i do a
page-up/page-down 
when i reach a particular set of data it crashes and gives me the error
looks like i am loading a character less than x'40' in the display file.

but how do i check tht.??


Data sent to device QPADEV001H not valid.  Negative response code is
  1005012D.

Permanent I/O error occurred in file DERWIND.
Function check. RNX1251 unmonitored by DERWINR at statement 0000000084,
  instruction X'0000'.



thanx & regards

Derek


From: "derek gonsalves" <d_gons@xxxxxxxxxxx>
Reply-To: RPG programming on the AS400 / iSeries 
<rpg400-l@xxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: single page subfile- position to problem...
Date: Wed, 11 Oct 2006 18:11:57 +0000

Hi

im posting my actual DDS and rpg program..(i am using it in a window
subfile)

Thanx N regards
Derek

-----------------------------------------------------------------------
-----------------------------------------------------------------
DDS for window subfile

-----------------------------------------------------------------------
-----------------------------------------------------------------


     A
     A
     A                                      DSPSIZ(24 80 *DS3)
     A          R WINSFL                    SFL
     A
     A            D#OPT          1A  B  5  2VALUES('X' ' ')
     A            D#TRNM        50A  B  5  4
     A            D#ISRC        10A  O  5 55
     A            H#PROD        15A  H
     A            H#ARTS        60A  H
     A            H#ISRC        20A  H
     A          R WINCTL                    SFLCTL(WINSFL)
     A*%%TS  SD  20061011  165430  DEREK       REL-V4R4M0  5769-PW1
     A                                      CA03(03 'F3=Exit')
     A                                      ROLLUP(75)
     A                                      ROLLDOWN(76)
     A  50                                  SFLDSP
     A  51                                  SFLDSPCTL
     A  55                                  SFLCLR
     A  90                                  SFLEND(*MORE)
     A                                      SFLSIZ(0008)
     A                                      SFLPAG(0008)
     A                                      WINDOW(5 12 15 64)
     A                                      WDWBORDER((*COLOR BLU) 
(*DSPATR
RI)-
     A                                       (*CHAR '        '))
     A            RRN1           4S 0H      SFLRCDNBR
     A                                  4  2'X'
     A                                      COLOR(WHT)
     A            D#RSCD        60A  B  3  4
     A                                  4  4'Track Name'
     A          R DUMMY
     A*%%TS  SD  20061011  165430  DEREK       REL-V4R4M0  5769-PW1
     A                                      ASSUME
     A                                 13  2' '
     A          R FOOTER
     A*%%TS  SD  20061011  165430  DEREK       REL-V4R4M0  5769-PW1
     A                                      OVERLAY
     A                                      WINDOW(WINCTL)
     A                                      WDWBORDER((*COLOR BLU) 
(*DSPATR
RI)-
     A                                       (*CHAR '        '))
     A                                 14  1'F3=Exit'
     A                                      COLOR(BLU)




-----------------------------------------------------------------------
-------------------------------------------------------------------
rpg program starts here

-----------------------------------------------------------------------
------------------------------------------------------------------




     HOPTION(*NODEBUGIO)

     ********************
     ** FILE DECLARATIONS
     ********************

     FLCDETLL3  IF   E           K DISK

     FDERWIND   CF   E             WORKSTN
     F                                     SFILE(WINSFL:RRN1)
     F                                     INFDS(INFO)

     ******************
     ** DATA STRUCTURES
     ******************

     DINFO             DS
     DCFKEY                  369    369

     DSVLTRCK          S                   LIKE(LDTRNM)
     DSVLPROD          S                   LIKE(LDPROD)

     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')
     D*SFLPAG           C                   CONST(8)
     DSFLPAG           S              3  0
     DSFLPAG_PLUS_1    C                   CONST(9)

     D*RRN1             S              3  0

     DW@FLAG           S              1

     ***************
     ** MAIN ROUTINE
     ***************

     C                   EXSR      $SFLCLR
     C                   EXSR      $SFLBLD

     C                   DOU       (CFKEY = EXIT)
     C**                 WRITE     FOOTER
     C                   EVAL      *IN51 = *ON
     C                   EXFMT     WINCTL
     C                   EVAL      *IN51 = *OFF

     C                   EXSR      $CHECK
     C                   IF        W@FLAG = 'Y'
     C                   LEAVE
     C                   ENDIF

     C                   SELECT
     C                   WHEN      (CFKEY = ENTER) AND (D#RSCD
<>*BLANKS)
     C     D#RSCD        SETLL     LCDETL1
     C                   EXSR      $SFLCLR
     C                   EXSR      $SFLBLD
     C                   CLEAR                   D#RSCD

     C*                  WHEN      (CFKEY = ROLLUP) AND (NOT *IN90)
     C                   WHEN      (*IN75 = *ON) AND (NOT *IN90)
     C                   EXSR      $SFLCLR
     C                   EXSR      $SFLBLD

     C*                  WHEN      (CFKEY = ROLLDN) AND (*IN50 = *ON)
     C                   WHEN      (*IN76 = *ON) AND (*IN50 = *ON)
     C                   EXSR      $GOBACK
     C                   EXSR      $SFLCLR
     C                   EXSR      $SFLBLD

     C                   ENDSL
     C                   ENDDO

     C                   EVAL      *INLR = *ON

     *********************
     ** $SFLCLR SUBROUTINE
     *********************

     C     $SFLCLR       BEGSR

     C                   EVAL      RRN1 = 0
     C                   EVAL      *IN55 = *ON
     C                   WRITE     WINCTL
     C                   EVAL      *IN55 = *OFF
     C                   EVAL      *IN50 = *ON

     C     #SFLCLR       ENDSR

     *********************
     ** $SFLBLD SUBROUTINE
     *********************

     C     $SFLBLD       BEGSR

     C                   EVAL      SFLPAG = 8

     C                   DO        SFLPAG
     C                   READ      LCDETL1

90
     C                   IF        *IN90 = *ON
     C                   LEAVE
     C                   ENDIF

     C*                  IF        LDCNFG <> 'CD' AND LDCNFG <> 'VD'
     C*                  READ      LCDETL1

90
     C***                EVAL      SFLPAG = SFLPAG + 1
     C*                  ITER
     C*                  ENDIF

     C                   EXSR      $MOVSCR
     C                   EVAL      RRN1 = RRN1 +1
     C                   WRITE     WINSFL

     ** SAVE THE FIRST RECORD DATA

     C                   IF        RRN1 = 1
     C                   EVAL      SVLTRCK = LDTRNM
     C                   EVAL      SVLPROD = LDPROD
     C                   ENDIF
     C                   ENDDO

     C                   IF        RRN1 = 0
     C                   EVAL      *IN50 = *OFF
     C                   ELSE
     C                   EVAL      *IN50 = *ON
     C                   ENDIF

     C     #SFLBLD       ENDSR

     *********************
     ** $GOBACK SUBROUTINE
     *********************

     C     $GOBACK       BEGSR

     C     SAVKEY        SETLL     LCDETL1
     C*    SVLTRCK       SETLL     LCDETL1

     C                   DO        SFLPAG_PLUS_1
     C                   READP     LCDETL1

90
     C                   IF        *IN90 = *ON
     C     *LOVAL        SETLL     LCDETL1
     C                   LEAVE
     C                   ENDIF
     C                   ENDDO

     C     #GOBACK       ENDSR

     *********************
     ** $MOVSCR SUBROUTINE
     *********************

     C     $MOVSCR       BEGSR

     C                   EVAL      D#TRNM = LDTRNM
     C                   EVAL      D#ISRC = LDISRC
     C                   EVAL      H#ISRC = LDISRC
     C                   EVAL      H#PROD = LDPROD
     C                   EVAL      H#ARTS = LDARTS

     C     #MOVSCR       ENDSR

     ********************
     ** $CHECK SUBROUTINE
     ********************

     C     $CHECK        BEGSR
     C                   EVAL      W@FLAG = 'N'
     C                   READC     WINSFL

81
     C                   IF        *IN81 = *OFF AND D#OPT = 'X'
     C                   EVAL      T#TRNM = D#TRNM
     C                   EVAL      T#ISRC = H#ISRC
     C                   EVAL      T#PROD = H#PROD
     C                   EVAL      T#ARTS = H#ARTS
     C                   EVAL      W@FLAG = 'Y'
     C                   ENDIF
     C     #CHECK        ENDSR

     ********************
     ** *INZSR SUBROUTINE
     ********************

     C     *INZSR        BEGSR

     C     SAVKEY        KLIST
     C                   KFLD                    SVLTRCK
     C                   KFLD                    SVLPROD

     C     *ENTRY        PLIST
     C                   PARM                    T#TRNM           60
     C                   PARM                    T#ISRC           20
     C                   PARM                    T#PROD           15
     C                   PARM                    T#ARTS           35

     C                   ENDSR







From: "Jonathan Mason" <jonathan.mason@xxxxxxxxxxxxxxxx>
Reply-To: RPG programming on the AS400 / iSeries 
<rpg400-l@xxxxxxxxxxxx>
To: "'RPG programming on the AS400 / iSeries'"
<rpg400-l@xxxxxxxxxxxx>
Subject: RE: single page subfile- position to problem...
Date: Wed, 11 Oct 2006 14:09:07 +0100

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.





--
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.



--
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 thread ...

Follow-Ups:

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.