Avatar of Leogal
Leogal
Flag for United States of America

asked on 

RPG Free Prototypes using *LDA data

I just started a job at a shop that has implemented new standards of programming prior to my hire.  We are to write in RPG free format only the C specs curenlty and and use newer solutions in the RPGLE D specs. In this case I am struggling a bit with prototypes  and  what I belive are called prototype Interfaces, specifically in conjuction with pulling in data from a *LDA.   My Sr got me started with the following code for my program PMI1002R.

The prototype:
 D PMI1002R        pr                   extpgm( 'PMI1002R')   
 D  Iplan                             5  0 const                  
 D  IMode                          1a   const                  
 D  IErrLn                          1a   const                  
 D  ILnMtch                       1a   const                  
 D  ICanTerm                    1a   const       

Open in new window


The prototype interface:
 D PMI1002R        pi                        
 D  Iplan                           5  0 const 
 D  IMode                        1a   const 
 D  IErrLn                         1a   const 
 D  ILnMtch                     1a   const 
 D  ICanTerm                  1a   const 

Open in new window


When I tried to run the RPG program I get the following error when trying to use the field Iplan:
Application error.  MCH3601 unmonitored by PMI1002R at statement
0000030800, instruction X'0000'.

Here is the statement:
  // Check loan in LoanFile
   Chain (Iplan) LoanFile;
  If %FOUND(LoanFile);    

The key field for LoanFile is defined as  Plan zoned length of 5, 0 decimal postions.

I think that the reason that I am getting this error is that while the field length is described in the prototype and prototype interface it does not describe that it is a *LDA and what postion the field starts in.   I am so new to the use of prototypes and prototype interfaces that I am not sure how to resolve the error.  I reallly would appreciate any help that I can get.
IBM System iDB2

Avatar of undefined
Last Comment
Gary Patterson, CISSP

8/22/2022 - Mon