Deleting the separate or last item of the periodic group

Hello!

How I can delete the separate or last item of the periodic group?

e.g. DELETE PER_GR(3)

Thanks in advance!

reset PER_GR(3)

1 Like

Thank you for your reply, Matthias! But this not work.
After this actions I must get the C*GBCH statement one less than the initial value, but this not happened.

Here is code:

FIND SPRK  KSPR=906 AND KREK=3185
RESET PER_GR(5)
display KREK C*PER_GR
loop
END OF TRANSACTION
END 

Regards,

What your little code snippet does is change the value in memory. It does NOT change the record until you do an UPDATE statement. Even then, you would have to re-acquire the record (say with a GET) in order to change C*

1 Like

Thanks, Steve. I know that I need to use UPDATE, but I don’t know what assign to PER_GR(5).

FIND SPRK  KSPR=906 AND KREK=3185  
  UPDATE(0010) SET PER_GR(5)=/*What is here??? 
loop  
END OF TRANSACTION  
END   

Could you attach the little code snippet please?

Thanks in advance!

RESET does what the name implies, it resets the variable(s) to their initial value, thus they will be compressed away when you UPDATE.

1 Like

My problem: I I have not used a structure mode :slight_smile:
Switched on it and it worked.

Thanks all!

Without a GET (or other acquisition of the record), there is no way your code would result in C* being decremented.

Structured vs Report mode is mainly syntactic; it does not change the way statements function.