ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Multi Occurences data structure in RPG 7.1 -*** Urgent help please ***

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

  • Multi Occurences data structure in RPG 7.1 -*** Urgent help please ***

    Experts,
    I have a multi occurences data structure as shown below , and I am using that in a procedure.
    Basically, the calling procedure is passing 5000 records, and I need determine the location of Data structure based on the
    data that i get from data area.
    below are the compile error i am getting



    dcl-ds TRec Occurs(5000);
    dcl-subf xtNumb zoned(6:0);
    dcl-subf xtNumb2 zoned(4:0);
    dcl-subf xtb zoned(9:2);
    End-ds;

    dcl-proc GetTNum export;

    dcl-pi GetTNum packed(9:2);
    TRec likeds(S4Rec) Const;


    Based on the Tnumb i am getting from data area, i need to to look at the location on the above Data stutture to get the xtb number.

    Xcounter = %Lookup(yxtb:TRec(*).xtb);

    I get below error

    RNF0571 20 1 The second parameter for %LOOKUPxx is not valid.
    *RNF7421 30 1 Operands are not compatible with the type of operator


    Any help is greatly appreciated
    Thanks
    Stillin400

  • #2
    Re: Multi Occurences data structure in RPG 7.1 -*** Urgent help please ***

    Sorry, I just figure that out.

    I was using date fiield ( The parm on my original question is not right, i was using a date field ). my search date was a date field, but my data struture field is 7,0.

    That's one of the main error.

    Also, I changed to to DIM instead of OCCURS, and everything works great. It should work as a OCCUR as well, but I have not tested thatt.


    Thanks
    Stillin400

    Comment

    Working...
    X