ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPF0859 during RCVF

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

  • CPF0859 during RCVF

    We have a program that purges old files from a library. The program uses DSPOBJD and outputs the result to a file in QTEMP. After checking for CPF2123 the next command is RCVF RCDFMT(QLIDOBJD).

    The program encounters CPF0859 during the RCVF but I don't understand why. he system automatically Dumps the job when the error is encoutnered.

    Code:
    CHKOBJ     OBJ(QTEMP/FILE_PURGE) OBJTYPE(*FILE)         
    MONMSG     MSGID(CPF9801) EXEC(GOTO CMDLBL(LIST))       
    DLTF       FILE(QTEMP/FILE_PURGE)                       
    
    DSPOBJD    OBJ(REPORTS/&DLTOBJ) OBJTYPE(*FILE) +      
                 OUTPUT(*OUTFILE) OUTFILE(QTEMP/FILE_PURGE) 
    MONMSG     MSGID(CPF2123) EXEC(DO)                      
    CHGVAR     VAR(&MSG) VALUE('No Files on Library +       
                 REPORTSTK')                                
    GOTO CMDLBL(SNDMSG)                                     
    ENDDO                                                   
    
    RCVF       RCDFMT(QLIDOBJD)

  • #2
    Seems like that isn't a complete program listing (no LIST label).

    Not sure if there's an override somewhere, but if FILE_PURGE is the only file declared in the program, you don't need any parameters included on the RCVF command.

    Cheers,

    Emmanuel

    Comment


    • #3
      As per Emmanuel, there isn't enough of the program to give an indication of the issue. CPF0859 is "File override caused I/O buffer size to be exceeded". I've not encountered that error before so supplying more of the code including the OVRDBF command would be useful.

      Comment


      • #4
        CPF0859 "File override caused I/O buffer size to be exceeded"

        When you compile a program that reads files using native IO (as opposed to SQL), the compiler creates program variables for each file column. The wording of this error suggests to me that those variables are too small for the file being read. The file must exist in the library list at compile time so that the compiler can know what columns the file has, so it can create those equivalent variables.

        So, file FILE_PURGE must have existed at compile time.

        This error suggests to me that the FILE_PURGE file referenced at compile time, is not the same format (record length and variable names/sizes) as the FILE_PURGE being run at runtime.

        This suggests two possible causes to me.

        Either there is an override in place somewhere so it is reading a different file that is not the same format as FILE_PURGE. In which case find that override and check what it's doing

        Or, the FILE_PURGE that existed at compile time is not the same format as the file created by the DSPOBJD command. In which case replace the compile-time FILE_PURGE file with one created from DSPOBJD, and then recompile the program

        Comment


        • Vectorspace
          Vectorspace commented
          Editing a comment
          typo: "...as the FILE_PURGE being *read* at runtime."

      • #5
        Here's the full code. FILE_PURGE was created in QTEMP before the program was compiled and the compiled object was transferred to another machine..
        Code:
                     PGM                                                
        
        /* Program Variables                                            
        
                     DCL        VAR(&CURDATE) TYPE(*CHAR) LEN(6)        
                     DCL        VAR(&CENTURY) TYPE(*CHAR) LEN(1)        
                     DCL        VAR(&ENVI)    TYPE(*CHAR) LEN(1)        
                     DCL        VAR(&DLTOBJ)  TYPE(*CHAR) LEN(10)      
                     DCL        VAR(&ZLDATE0) TYPE(*CHAR) LEN(50)      
                     DCL        VAR(&DDATE)   TYPE(*CHAR) LEN(6)        
                     DCL        VAR(&CDATE)   TYPE(*CHAR) LEN(6)        
                     DCL        VAR(&EDATE)   TYPE(*CHAR) LEN(6)        
                     DCL        VAR(&DDUR)    TYPE(*CHAR) LEN(3)        
                     DCL        VAR(&MSG)     TYPE(*CHAR) LEN(50)      
                     DCL        VAR(&COUNT)   TYPE(*DEC) LEN(5 0)      
                     DCL        VAR(&CR8D8)   TYPE(*CHAR) LEN(6)        
                     DCL        VAR(&MSGCNT)  TYPE(*CHAR) LEN(5)        
        
                     DCLF       FILE(QTEMP/FILE_PURGE) RCDFMT(QLIDOBJD)
        
        /*Retrieve system values AND data area values                                 */
                     RTVSYSVAL  SYSVAL(QDATE)    RTNVAR(&CURDATE)                        
                     RTVSYSVAL  SYSVAL(QCENTURY) RTNVAR(&CENTURY)                        
        
                     RTVDTAARA  DTAARA(PURGDTA10 (1 1))   RTNVAR(&ENVI)                    
                     RTVDTAARA  DTAARA(DTAPURGE (1 3)) RTNVAR(&DDUR)                    
        
        /*Compute retention date                                                      */
              /*In case of subs with other format, convert current date format to YMD*/  
                     CVTDAT     DATE(&CURDATE) TOVAR(&CDATE) +                          
                                  FROMFMT(*SYSVAL) TOFMT(*YMD) TOSEP(*NONE)              
        
                     CHGVAR     VAR(&ZLDATE0) VALUE('00000000000 +                      
                                  000000000000000                      ')                
                     CHGVAR     VAR(%SST(&ZLDATE0 3 6)) VALUE(&CDATE)                    
        
                     IF         COND(&CENTURY *EQ '0') THEN(DO)                          
                     CHGVAR     VAR(%SST(&ZLDATE0 1 2)) VALUE('19')                      
                     ENDDO                                                              
                     IF         COND(&CENTURY *EQ '1') THEN(DO)                          
                     CHGVAR     VAR(%SST(&ZLDATE0 1 2)) VALUE('20')                      
                     ENDDO                                                              
        
                     CHGVAR     VAR(%SST(&ZLDATE0 12 1)) VALUE('-')                      
                     CHGVAR     VAR(%SST(&ZLDATE0 13 3)) VALUE(&DDUR)                    
                     CALL       PGM(FDATE) PARM(&ZLDATE0)                                
                     CHGVAR     VAR(&DDATE) VALUE(%SST(&ZLDATE0 18 06))                  
        
        /*Check REPORTLIB Library if existing                                       */  
                     CHKOBJ     OBJ(REPORTLIB) OBJTYPE(*LIB)                            
                     MONMSG     MSGID(CPF9801) EXEC(DO)                                  
                     CHGVAR     VAR(&MSG) VALUE('Library REPORTLIB does not +            
                                  exist.')                                              
                     GOTO CMDLBL(SNDMSG)                                                
                     ENDDO                                                              
        
        /*Set enrironment to retrieve                                                 */
                     CHGVAR     VAR(&DLTOBJ) VALUE('RE' *CAT &ENVI *CAT +                
                                  '*')                                                  
        /*Check Object if existing                                                    */
                     CHKOBJ     OBJ(QTEMP/FILE_PURGE) OBJTYPE(*FILE)                    
                     MONMSG     MSGID(CPF9801) EXEC(GOTO CMDLBL(LIST))                  
                     DLTF       FILE(QTEMP/FILE_PURGE)                                  
        
        /* Extract Files                                                              */
         LIST:       DSPOBJD    OBJ(REPORTLIB/&DLTOBJ) OBJTYPE(*FILE) +                  
                                  OUTPUT(*OUTFILE) OUTFILE(QTEMP/FILE_PURGE)            
                     MONMSG     MSGID(CPF2123) EXEC(DO)                                  
                     CHGVAR     VAR(&MSG) VALUE('No Files on Library +                  
                                  REPORTLIB')                                            
                     GOTO CMDLBL(SNDMSG)                                                
                     ENDDO                                                              
        
        /* Delete  Files                                                             */  
         NEXTREC:    RCVF       RCDFMT(QLIDOBJD)                                        
        
                     MONMSG     MSGID(CPF0864) EXEC(DO)                                  
                     IF         COND(&COUNT *GE 1) THEN(DO)                              
                     CHGVAR     VAR(&MSGCNT) VALUE(&COUNT)                    
                     CHGVAR     VAR(&MSG) VALUE(&MSGCNT *CAT ' Files +        
                                  Successfully Deleted.')                    
                     ENDDO                                                    
                     ELSE       CMD(DO)                                      
                     CHGVAR     VAR(&MSG) VALUE('No Files deleted on Library +
                                  REPORTLIB')                                
                     ENDDO                                                    
                     GOTO CMDLBL(SNDMSG)                                      
                     ENDDO                                                    
        
                     CVTDAT     DATE(&ODCDAT) TOVAR(&CR8D8) FROMFMT(*MDY) +  
                                  TOFMT(*YMD) TOSEP(*NONE)                    
        
                     IF         COND(&CR8D8 *LT &DDATE) THEN(DO)              
                     DLTF       FILE(&ODLBNM/&ODOBNM)                        
                     CHGVAR     VAR(&COUNT) VALUE((&COUNT + 1))              
                     ENDDO                                                    
        
                     GOTO       CMDLBL(NEXTREC)
        Last edited by JustinWithoutAnE; December 17, 2020, 02:55 AM.

        Comment


        • #6
          There are no overrides in that program. It does call program FDATE, does that do anything with file FILE_PURGE?

          If not, then I think the problem is that the QTEMP/FILE_PURGE file that exists compile time, is not the same format as the file produced by DSPOBJD

          Comment


          • #7
            Are the two machines at the same OS release level? New releases can change the format of system files like the one produced by DSPOBJD. Do a DSPFFD on file QADSPOBJ on both systems and check the format level identifier to see if they are different.

            Comment

            Working...
            X