Compilation error RNF5199

Compilation error RNF5199
Compilation error RNF5199, RNF5199, compilation error, compile time error in ibmi as400, compile time error in rpg, Factor 2 operand is not valid for EXFMT operation, dspf, display file in ibmi as400, ibmi, as400 and sql tricks
Compilation error RNF5199

Hi, we are trying to create one display file that is created sucessfully and then the RPGLE program using DSPF and trying to compile that rpgle program using DSPF.

Below is the DSPF source code for display file named DSPF_1.

    A          R RCD1                                     
    A  10                                  ALARM          

Below is the RPGLE program source code DSPF_1RPG using display file named DSPF_1.

     FDSPF_1    IF   E             WORKSTN      
      /Free                                     
       *in10 = *on;                             
       exfmt RCD1;                              
       *in10 = *off;                            
       *inlr = *on;                             
      /End-Free                                 

The compile time error RNF5199 occurs during program compilation step which says "Factor 2 operand is not valid for EXFMT operation."

when checked the compilation report then error description was "Factor 2 operand is not valid for EXFMT operation. "

What is the cause of error RNF5199?

The solution to this RNF5199 error is in the above program the DSPF defined as Input-only file and EXFMT is (WRITE(Output) + READ(Input)) operation i.e. performed the combined operation. So, we cannot use EXFMT on an input-only file.

So, please change above f-spec from IF (input full-procedural) to CF (combined full procedural) and your program will be successfully compiled.

Therefore, the final code will be

     FDSPF_1    CF   E             WORKSTN            
      /Free                                           
       *in10 = *on;                                   
       exfmt RCD1;                                    
       *in10 = *off;                                  
       *inlr = *on;                                   
      /End-Free                                       

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain