COUNTER returns a CHARACTER string of length 5 containing a decimal number. The returned number is 00001 for the first invocation, and is incremented by one on each successive invocation.
|
If COUNTER is invoked 99999 times, the next time it is invoked, a diagnostic message is issued and 00000 is returned. The next invocation after that is treated as the first.
The COUNTER built-in function can be used to generate unique names, or for counting purposes.