ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPF500A Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CPF500A Error

    Hi all,

    I've created a program that will display records into a window subfile. But when I run it I get the following error:

    Code:
    Session or device error occurred in file LC01SC07 (C G D F).
    I debugged the program and I saw the debug stopped at this line:

    Code:
         C                   write     WFOOT1
    I checked the joblog and I saw this:

    Code:
    2>> CALL LC01RP07                                                           
        Window does not exist.                                                  
      ? C                                                                       
        Window does not exist.                                                  
      ? C                                                                       
        Session or device error occurred in file LC01SC07.                      
        Function check. RNX1255 unmonitored by LC01RP07 at statement 0000000092,
          instruction X'0000'.                                                  
        Session or device error occurred in file LC01SC07 (C G D F).            
        Session or device error occurred in file LC01SC07 (C G D F).
    The full description of the error 'Window does not exist' is
    Code:
                             Additional Message Information                         
                                                                                    
     Message ID . . . . . . :   CPF500A       Severity . . . . . . . :   40         
     Message type . . . . . :   Sender copy                                         
     Date sent  . . . . . . :   08/29/09      Time sent  . . . . . . :   08:19:46   
                                                                                    
     Message . . . . :   Window does not exist.                                     
     Cause . . . . . :   An attempt was made to display a window record in a window 
       that is not currently being displayed.                                       
     Recovery  . . . :   Either specify a record format name of a window that is    
       currently being displayed, or specify a window position in the WINDOW        
       keyword to create a new window.  Then try the request again.                 
     Possible choices for replying to message . . . . . . . . . . . . . . . :       
       C -- Signal escape message CPF5104.                                          
       I -- I/O request ignored. Continue with next instruction.
    I'm guessing that this error points to the WFOOT1... but I declared it in my display file.

    LC01SC07
    Code:
         A*
         A*
         A                                      DSPSIZ(24 80 *DS3)
         A                                      VLDCMDKEY(40)
         A                                      CF05
         A                                      CF12
         A                                      PAGEUP
         A                                      PAGEDOWN
         A          R WSFL1                     SFL
         A*
         A  60                                  SFLNXTCHG
         A            SOPT           1A  B  9  2
         A  41                                  DSPATR(RI)
         A  41                                  DSPATR(PC)
         A            SCOLORCDE      3A  O  9  5
         A            SCOLORNME     20A  O  9 11
         A          R WCTL1                     SFLCTL(WSFL1)
         A*
         A  25                                  SFLDSP
         A N26                                  SFLDSPCTL
         A  26                                  SFLCLR
         A  27                                  SFLEND(*MORE)
         A                                      SFLSIZ(0005)
         A                                      SFLPAG(0005)
         A                                      WINDOW(5 15 17 35 *NOMSGLIN)
         A                                  3  1'Select from the ff:'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  6  1'OPT'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  5  1'1=Select'
         A                                      COLOR(BLU)
         A                                  6  5'COLOR'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  7  5'CODE'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  6 11'COLORNAME'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A            SPCOLORCDE     3A  B  8  5
         A          R WFOOT1
         A*
         A                                      OVERLAY
         A                                      WINDOW(WCTL1)
         A                                 16  1'F12=Cancel'
         A                                      COLOR(BLU)
         A          R NOREC1
         A*
         A                                      OVERLAY
         A                                      WINDOW(WCTL1)
         A                                  9  7'No records found.'
         A                                      DSPATR(BL)
         A                                      COLOR(RED)
         A                                  3  1'Select from the ff:'
         A                                      COLOR(WHT)
         A                                  5  1'1=Select'
         A                                      COLOR(BLU)
         A                                  7  5'CODE'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  6  1'OPT'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  6  5'COLOR'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A                                  6 11'COLOR NAME'
         A                                      COLOR(WHT)
         A                                      DSPATR(UL)
         A          R RASSUME
         A*
         A                                      KEEP
         A                                      ASSUME
         A                                 23  3' '
    What could be the problem? Any help would be very much appreciated.

    Oh BTW, here is the RPG code:

    LC01RP07
    Code:
         H
         FLC01PF07  uf   e           k disk
         FLC01SC07  cf   e             workstn sfile(WSFL1:vrrn)
         F                                     infds(dsWorkStn)
         D dsWorkStn       ds
         D  keypress             369    369a
         D CF12            c                   const(x'3C')
         D CF5             c                   const(x'35')
         D ENTER           c                   const(x'F1')
         D CPAGEUP         c                   const(x'F4')
         D CPAGEDOWN       c                   const(x'F5')
         D
         D vrrn            s              4p 0
         D fEndProgram     S              1n   inz(*off)
         D fError          S              1n   inz(*off)
         D kCCOLORCDE      S                   like(CCOLORCDE)
         D kCCOLORCDEL     S                   like(CCOLORCDE)
         D vBOF            c                   const('Beginning of file')
         D vEOF            c                   const('End of file')
         D vSFLPAG         c                   const(5)
         D vSFLPAGPlus1    c                   const(6)
          * ----------------------------------------------------------
          * MAINLINE
          * ----------------------------------------------------------
         C                   exsr      housekeeping
         C                   exsr      clearsfl
         C                   exsr      loadsfl
         C                   exsr      displaysfl
         C                   eval      *inlr = *on
          * ----------------------------------------------------------
          * CLEARSFL
          * ----------------------------------------------------------
         C     clearsfl      begsr
         C                   eval      *in60 = *off
         C                   eval      *in41 = *off
         C                   eval      SOPT  = *blanks
         C                   eval      *in25 = *off
         C                   eval      *in27 = *off
         C                   eval      *in26 = *on
         C                   write     WCTL1
         C                   eval      *in26 = *off
         C                   endsr
          * ----------------------------------------------------------
          * LOADSFL
          * ----------------------------------------------------------
         C     loadsfl       begsr
         C                   eval      vrrn = *zeros
         C                   eval      kCCOLORCDE  = *blanks
         C                   dou       %eof(LC01PF07) or
         C                             vrrn = vSFLPAG
         C                   read      LC01PF07
         C                   if        not %eof(LC01PF07)
         C                   eval      SCOLORCDE = CCOLORCDE
         C                   eval      SCOLORNME = CCOLORNME
         C                   eval      vrrn = vrrn + 1
         C                   write     WSFL1
         C                   endif
         C                   if        vrrn = 1
         C                   eval      kCCOLORCDE = CCOLORCDE
         C                   endif
         C                   enddo
         C                   if        vrrn > 1
         C                   eval      kCCOLORCDEL = CCOLORCDE
         C                   endif
         C                   if        vrrn > 0 and %eof(LC01PF07)
         C                   eval      *in27 = *on
         C                   endif
         C                   endsr
          * ----------------------------------------------------------
          * DISPLAYSFL
          * ----------------------------------------------------------
         C     displaysfl    begsr
         C                   eval      fEndProgram = *off
         C                   dow       fEndProgram = *off
         C                   write     WFOOT1
         C                   if        vrrn > 0
         C                   eval      *in25 = *on
         C                   exfmt     WCTL1
         C                   else
         C                   eval      *in25 = *off
         C                   exfmt     NOREC1
         C                   endif
         C*                  eval      smsg = *blanks
         C                   select
         C                   when      keypress = CF12
         C                   eval      fEndProgram = *on
         C                   when      keypress = CF5
         C     *loval        setll     LC01PF07
         C                   exsr      clearsfl
         C                   exsr      loadsfl
         C                   when      keypress = CPAGEDOWN
         C                   if        *in27 = *off
         C                   exsr      clearsfl
         C                   exsr      loadsfl
         C                   else
         C*                  eval      smsg = vEOF
         C                   endif
         C                   when      keypress = CPAGEUP
         C                   exsr      clearsfl
         C                   exsr      loadsflrev
         C                   exsr      loadsfl
         C                   when      keypress = ENTER
         C                   if        SPCOLORCDE <> *blanks
         C                   exsr      positionSFL
         C                   eval      spcolorcde = *blanks
         C                   else
         C                   eval      fError = *off
         C                   exsr      chkOption
          *
         C                   if        fError = *off
         C                   exsr      prcOption
         C                   endif
          *
         C                   endif
         C                   endsl
         C                   enddo
         C                   endsr
          * ----------------------------------------------------------
          * LOADSFLREV
          * ----------------------------------------------------------
         C     loadsflrev    begsr
         C                   eval      vrrn = *zeros
         C                   if        kCCOLORCDE <> *blanks
         C     kLC01PF07     setll     LC01PF07
         C                   else
         C     *loval        setll     LC01PF07
         C                   endif
         C                   dou       %eof(LC01PF07) or
         C                             vrrn = vSFLPAGPlus1
         C                   eval      vrrn = vrrn + 1
         C                   readp     LC01PF07
         C                   if        %eof(LC01PF07)
         C     *loval        setll     LC01PF07
         C                   eval      vrrn = vSFLPAGPlus1
         C*                  eval      smsg = vBOF
         C                   endif
         C                   enddo
         C                   endsr
          * ----------------------------------------------------------
          * POSITIONSFL
          * ----------------------------------------------------------
         C     positionSFL   begsr
          *
         C     SPCOLORCDE    setll     LC01PF07
         C                   exsr      clearsfl
         C                   exsr      loadsfl
          *
         C                   endsr
          * ----------------------------------------------------------
          * CHKOPTION
          * ----------------------------------------------------------
         C     chkoption     begsr
          *  1st readc for trapping invalid options
         C                   readc     WSFL1
         C                   dow       not %eof
         C                   eval      *in60 = *off
         C                   eval      *in41 = *off
         C                   if        SOPT  <> '1' and
         C                             SOPT  <> *blanks
         C                   eval      fError = *on
         C*                  eval      smsg = 'Invalid option'
         C                   eval      *in41 = *on
         C                   eval      *in60 = *on
         C                   update    WSFL1
         C                   else
         C                   eval      *in60 = *on
         C                   update    WSFL1
         C                   endif
         C                   readc     WSFL1
         C                   enddo
         C                   endsr
          * ----------------------------------------------------------
          * PRCOPTION
          * ----------------------------------------------------------
         C     prcoption     begsr
         C
         C                   readc     WSFL1
         C                   dow       not %eof
         C                   select
         C                   when      SOPT  = '1'
         C                   eval      SOPT  = *blanks
         C                   eval      *in60 = *off
         C                   eval      *in41 = *off
         C                   update    WSFL1
         C                   when      SOPT  = ' '
         C                   eval      *in60 = *off
         C                   eval      *in41 = *off
         C                   update    WSFL1
         C                   endsl
         C                   readc     WSFL1
         C                   enddo
         C
         C                   if        kCCOLORCDE <> *blanks
         C     kCCOLORCDE    setll     LC01PF07
         C                   exsr      clearsfl
         C                   exsr      loadsfl
         C                   else
         C     *loval        setll     LC01PF07
         C                   exsr      clearsfl
         C                   exsr      loadsfl
         C                   endif
         C
         C                   endsr
          * ----------------------------------------------------------
          * HOUSEKEEPING
          * ----------------------------------------------------------
         C     housekeeping  begsr
         C     kLC01PF07     klist
         C                   kfld                    kCCOLORCDE
         C                   eval      kCCOLORCDE = *blanks
         C     *loval        setll     LC01PF07
         C                   endsr
    Any help will be very much appreciated. Thanks in advance guys.

    Cliffyboy18

  • #2
    Re: CPF500A Error

    b4 you write your footer...you have to write the window..
    not sure why there is a window on your footer...

    if you put window round regular subfile you can then write the footer
    in the bottom of that window...

    Code:
    write  WCTL1
    write     WFOOT1
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: CPF500A Error

      Ah... it's now working... thanks!!

      Cliffyboy18

      Comment

      Working...
      X