NUMERO: Insert additonal logic in a sequence number counter

Use the entry point NUMERO to insert additional logic in the assignment of a number from a sequence number counter.

Context and operating mode

In most cases, a transaction is in progress, however this does depend on the calling program. Similarly, depending on the context, there may or may not be a log file open.

The following variables are on line:

Variable or mask

Definition

Char COMPTEUR

Sequence number counter name

Char SIT

Site

Date DAT

Date

Char COMP

Value of the additional field

Char VALEUR

Sequence number counter value

Integer STAT

Error status (0=OK, else error)

Integer PERIODE

Period

It is possible, for example, to reassign the value of COMP as a function of the value of COMPTEUR and the calling context. You must then ensure the sequence number counter can only be used by a single program, or in the same context.

The variable GPE is tested on the return from the entry point. A return of zero triggers the exit from the subprogram and the remainder of the standard process is not executed. Increase the sequence number counter (AVALNUM table) and return VALEUR for the sequence number counter number.

NUMEROCHG: Modify a sequence number counter

Use the entry point NUMEROCHG to change the number assigned from a sequence number counter.

Context and operating mode

In most cases, a transaction is in progress, however this does depend on the calling program. Similarly, depending on the context, there may or may not be a log file open. 

The following variables are on line:

Variable or mask

Definition

Char COMPTEUR

Sequence number counter name

Char SIT

Site

Date DAT

Date

Char COMP

Value of the additional field

Char VALEUR

Sequence number counter value

Integer STAT

Error status (0=OK, else error)

Integer PERIODE

Period

It is possible, for example, to modify the value of VALEUR according to the value of COMPTEUR and the calling context. You must then ensure the sequence number can only be used by a single program, or in the same context.