You are here: Development Standards > Routines > General Routines > GENSEQ.PUB

# GENSEQ.PUB

GENSEQ.PUB is a public program for allocating sequence numbers for history files that need a unique identifier. Entires are stored in the OSSE file, and are saved by file name.

If you intend to use GENSEQ.PUB, the file's primary key that you are reserving sequence numbers for should be a single segment, and have no alpha records in the file.

`0030 ENTER OSSECH,HISTCH,FILE$,CID$,OSSE$,SEQ$`

Variable | Description
OSSECH | Channel OSSE is opened on. If this parameter is 0, GENSEQ.PUB will open and close the OSSE file.
HISTCH | Channel the specific history file is opened on. This is used to determine the last available sequence number.
FILE$ | File name to reserved a sequence number for.
CID$ | Current company ID
OSSE$ | String template for the OSSE file
SEQ$ | Sequence number reserved by GENSEQ.PUB

Exit Points | Explanation
EXIT | GENSEQ.PUB does not return any errors.