ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Error RNF5343: Array DP# has too many omitted indexes.

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

  • Error RNF5343: Array DP# has too many omitted indexes.

    I have a program that I'm doing something really stupid but I can't figure out what it is... it won't compile when trying to call an external program...

    Below is the declarations:
    Code:
           Dcl-S A1#             Char(50) Dim(10);                                  // MLT ADDRESS 1
           Dcl-S A2#             Char(50) Dim(10);                                  // MLT ADDRESS 2
           Dcl-S Ct#             Char(50) Dim(10);                                  // MLT CITY
           Dcl-S St#             Char(2) Dim(10);                                   // MLT STATE
           Dcl-S Z5#             Char(5) Dim(10);                                   // MLT ZIP CODE
           Dcl-S Z4#             Char(4) Dim(10);                                   // MLT ZIP+4
           Dcl-S Cr#             Char(4) Dim(10);                                   // MLT CRRT
           Dcl-S Dp#             Char(3) Dim(10);                                   // MLT DPBC
           Dcl-S Dbfl            Char(1);
    
           DCL-PR ML2194 EXTPGM('ML2194');
             FIRM##_         LIKE(FIRM##);                                          // FIRM NAME
             ADR1##_         LIKE(ADR1##);                                          // SEC ADDRESS
             ADR2##_         LIKE(ADR2##);                                          // DEL ADDRESS
             CITY##_         LIKE(CITY##);                                          // CITY
             STAT##_         LIKE(STAT##);                                          // STATE
             ZIPC##_         LIKE(ZIPC##);                                          // ZIP CODE
             ZIP4##_         LIKE(ZIP4##);                                          // ZIP+4 CODE
             LLIN##_         LIKE(LLIN##);                                          // ADDR LAST LINE
             CRRT##_         LIKE(CRRT##);                                          // CARRIER ROUTE
             DPBC##_         LIKE(DPBC##);                                          // DPBC & CHK DGT
             ECOD##_         LIKE(ECOD##);                                          // ERROR CODE
             A1#_            LIKE(A1#);                                             // MLT ADDRESS 1
             A2#_            LIKE(A2#);                                             // MLT ADDRESS 2
             CT#_            LIKE(CT#);                                             // MLT CITY
             ST#_            LIKE(ST#);                                             // MLT STATE
             Z5#_            LIKE(Z5#);                                             // MLT ZIP CODE
             Z4#_            LIKE(Z4#);                                             // MLT ZIP+4
             CR#_            LIKE(CR#);                                             // MLT CARRIER RT
             DP#_            LIKE(DP#);                                             // MLT DPBC & C/D
             DBFL_           LIKE(DBFL);                                            // ZIP+4 D/B ERR
           END-PR ML2194;
    The statement is:

    Code:
           ML2194 ( FIRM## : ADR1## : ADR2## :
           CITY## : STAT## : ZIPC## : ZIP4## :
           LLIN## : CRRT## : DPBC## : ECOD## : A1# :
           A2# : CT# : ST# : Z5# : Z4# : CR# : DP#
           : DBFL );
    When it compiles I get:
    Code:
    RNF5343: Array A1# has too many omitted indexes.
    RNF5343: Array DP# has too many omitted indexes.
    RNF5343: Array CR# has too many omitted indexes.
    RNF5343: Array Z4# has too many omitted indexes.
    RNF5343: Array Z5# has too many omitted indexes.
    RNF5343: Array ST# has too many omitted indexes.
    RNF5343: Array CT# has too many omitted indexes.
    RNF5343: Array A2# has too many omitted indexes.
    I do not know what it's complaining about. I believe the variables are defined in the correct order with correct dimensions - nothing is omitted as far as I can tell.

    Any insights?

  • #2
    I don't know what the ML2194 program is expecting but given you are trying to pass an array in the call, I am guessing it is expecting a 10 element array.
    Although you have used a LIKE in your prototype definition, the LIKE does not define the array definition, you need to use e.g. LIKE(A1#) DIM(10) etc.
    Last edited by john.sev99; August 5, 2019, 02:53 PM.

    Comment


    • #3
      I knew it was something simple and stupid! Sheesh... can I go home now? LOL

      Thank you!

      Comment


      • #4
        We've all made stupid mistakes before, and we all will again.

        I'm sure you know this Rocky, but for anyone else: the value of the DIM definition can also be made to be the same as another field.

        LIKE(A1#) DIM(%ELEM(A1#))

        However, in my experience, this will not work if the array is used by an SQL statement (the SQL precompiler is not smart enough for this yet, it always expects DIM values to be literals)

        Comment

        Working...
        X