Foreach not working as expected

Hello,
I have the following code snippet

TYPEDEF tuple<DATETIME serviceDate,String dateType,String ndc> CALL_CLAIM_DATE;
TYPEDEF tuple<DATETIME callDate,String ndc> CALL_DATE;
HeapAccum<CALL_CLAIM_DATE>(100, serviceDate ASC,dateType ASC) @actualsortedCallClaimDates;
ListAccum<CALL_DATE> @predictedCallDate;
SumAccum<Int> @x;

INDV = select t from INDV:t
ACCUM
    foreach k in t.@predictedCallDate do
        foreach j in t.@actualsortedCallClaimDates do
            t.@x += 1 ,
           //other computations
        end
     end;

Although the data structures @predictedCallDate and @actualsortedCallClaimDates have data the x is always 0, it never enters the inner loop. Any idea why this is happening. I have tried both accum and post-accum
Regards,
Debraj

I’m guessing you’ve edited the code here as the SumAccum declaration is invalid (it has no type declaration), so shouldn’t install or run.

Otherwise, there isn’t anything obviously wrong. Can you post code that replicates the issue?

How was the data added to @predictedCallDate ?

its just list operation. += CALL_DATE().
I got the problem. At one place the code went to a loop where it was popping the heap accum