This is an addendum to what was written above. The above was written by my boss. We're a bit perplexed on this issue. Here is the code I have tried to come up with, which is not working.
data util.throut;
set util.throut;
do record = 1 to 11037;
a=1;
counter=a;
x=claim;
do until (x^=claim);
sequence=counter;
a=counter;
counter=a+1;
end;
end;
I am pulling claims from a table called 'throut', and am populating a field called sequence. What I want to do is assign each line of the claim a number (the table is already sequenced in the order I want to go, and there are a total of 11,037 records)
For instance, claim A has 3 lines, so I need to assign line 1 a sequence value of 1, line 2 a sequence value of 2, etc. Then when claim B comes up on record 4, it would start over again at 1, and start the count all over again.
When I run the code above, it loops endlessly, so I assume it's getting stuck in the first loop and never exiting when the claim # changes. Or else it isn't changing records. Anyway, any help from anyone would be very much appreciated.