ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Cpf4104 Error!!!!need Help,

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

  • Cpf4104 Error!!!!need Help,

    Hai,

    I am tryin display a customer details and respective cardetails and m using subfiles.And i need to update in the subfile.This my code.

    Code:
    FEMPPF   UF  E           K        DISK                        
    FVDETL   UF  E           K        DISK                        
    FCV1     CF  E                    WORKSTN                     
    F                                        RRN1  KSFILE CVSUB   
    ********************************************************
    C* MAIN PROGRAM                                               
    ********************************************************
    C                     Z-ADD0         RRN1    40               
    C           *IN03     DOWEQ*OFF                               
    C                     SETON                     27            
    C                     EXSR CSFL                               
    C                     EXSR LSFL                               
    C                     EXSR DSPSF                              
    C                     ENDDO                                   
    C                     SETON                     LR            
    ********************************************************
    C* SUBROUTIME TO CLEAR THE SUBFULE                          
    ********************************************************
    C           CSFL      BEGSR                                 
    C                     SETON                     25          
    C                     WRITECVCTL                            
    C                     SETOF                     25          
    C                     Z-ADD0         RRN1                   
    C                     ENDSR                                 
    ********************************************************
    C* SUBROUTINE TO LOAD A SUBFILE                             
    ********************************************************
    C           LSFL      BEGSR                                 
    C                     SETOF                     70          
    C           EID       SETLLVDETL                            
    C           EID       READEVRECL                    86      
    C           *IN86     IFEQ *ON                              
    C                     SETOF                     70          
    C                     ENDIF                                 
    C           *IN86     DOWEQ*OFF                             
    C                     EXSR MDB                              
    C                     ADD  1         RRN1                   
    C                     WRITECVSUB                    86      
    C           EID       READEVRECL                    86      
    C                     ENDDO                                 
    C                     ENDSR                                 
    ********************************************************
    C* DISPLAY SUBFILE                                          
    ********************************************************
    C           DSPSF     BEGSR                                 
    C           RRN1      IFEQ 0                                
    C                     CLEARCVSUB                            
    C                     ADD  1         RRN1                   
    C                     WRITECVSUB                         
    C                     SETON                     26       
    C                     ENDIF                              
    C                     SETON                     27       
    C                     WRITECVCTL                         
    C                     WRITEFOOTER                        
    C                     EXFMTCVCTL                         
    C           *IN07     IFEQ *OFF                          
    C                     EXSR UPD                           
    C                     ENDIF                              
    C                     ENDSR                              
    ********************************************************
    C* SUBROUTINE TO UPDATE                                  
    ********************************************************
    C           UPD       BEGSR                              
    C                     READCCVSUB                    89   
    C           *IN89     DOWEQ*OFF                         
    C           EID       CHAINEMPPF                86      
    C           *IN86     IFEQ *OFF                         
    C                     EXSR MSD                          
    C                     UPDATEMPD                         
    C                     UPDATVRECL                        
    C                     READCCVSUB                    89  
    C                     ENDIF                             
    C                     ENDDO                             
    C                     ENDSR                             
    ********************************************************
    C* SUBROUTINE TO MOVE FROM DATABASE FIELDS TO SUBFILE FI
    ********************************************************
    C           MDB       BEGSR                             
    C                     MOVE ENAME     ENAME              
    C                     MOVE EADDR     EADDR              
    C                     MOVE ETEL      ETEL        
    C                     MOVE CHASIS    CHASIS      
    C                     MOVE MODEL     MODEL       
    C                     MOVE MYEAR     MYEAR       
    C                     MOVE ENO       ENO         
    C                     ENDSR                      
    ********************************************************
    C* SUBROUTINE TO MOVE FILEDS FROM SUBFILES TO DAT
    ********************************************************
    C           MSD       BEGSR                      
    C                     MOVE ENAME     ENAME       
    C                     MOVE EADDR     EADDR       
    C                     MOVE ETEL      ETEL        
    C                     MOVE CHASIS    CHASIS      
    C                     MOVE MODEL     MODEL       
    C                     MOVE MYEAR     MYEAR       
    C                     MOVE ENO       ENO    
    C                     ENDSR
    The program is compiling ,but when i call the program ,the error i get is

    Error message CPF4194 appeared during OPEN (C S D F)

    And i suppose th CPF4194 error means only input not allowed to update or delete.
    Hoe to fix this problem, and what error did i make in the program.Pls HELP.

    Thanx
    Andrew....
    Last edited by gcraill; March 2, 2008, 04:08 AM. Reason: [ /CODE ] tag

  • #2
    Re: Cpf4104 Error!!!!need Help,

    Andrew,

    Not sure of the complete reasons, but I do notice that you have WRITE statements but the files are not declared for "ADD" option. If you do not declare it with "A" then you can only Update.

    Code:
    C                     WRITECVCTL
    This
    Code:
    FVDETL   UF  E           K        DISK
    Needs to be something like this
    Code:
    FVDETL   UF A E           K        DISK
    Which line is it reporting an error on ?

    GC
    Greg Craill: "Life's hard - Get a helmet !!"

    Comment


    • #3
      Re: Cpf4104 Error!!!!need Help,

      Hai greg,

      CVCTL is a subfile control .We dont need to add A in the f-spec of the dds,and cant also add A to the dds ,if im rite.There is someother error in the program.

      Comment


      • #4
        Re: Cpf4104 Error!!!!need Help,

        Hit on the CPF4194 message to get additional information.
        Philippe

        Comment


        • #5
          Re: Cpf4104 Error!!!!need Help,

          First, Which file is failing to open ? DO a DSPJOBLOG after the errors, and look for messages before the CPF4194

          Comment


          • #6
            Re: Cpf4104 Error!!!!need Help,

            Hai,
            The file thats not opening is the VDETL file ,which is the logical file that joins both the customer details PF and the car details PF.

            Comment


            • #7
              Re: Cpf4104 Error!!!!need Help,

              The file thats not opening is the VDETL file ,which is the logical file that joins both the customer details PF and the car details PF.
              ... and you defined it as update file!
              Join logical files are not updateable!
              For Updates or Writes you need either to use the physical file or an unjoined logical file.

              Birgitta

              Comment

              Working...
              X