Here's something you won't see very often: instead of DATA:
you can also declare your variabele in a routine as STATICS:
. What this will do is bombard the locally defined variabele a global variabele. However one that is not available outside the routine. So if you were to use it as a counter, you can increase the counter when you are about to leave the routine and find an increased counter when you next call the routine.
write: / ga_var. do 3 times. perform kaas. enddo. write: / 'more', ga_var. form kaas. statics: ga_var type char20. concatenate ga_var 'X' into ga_var. write: / ga_var. endform.
Will show
Cookies X XX XXX more Cookies