compile insert select.constants

* MISC EQUATES *
* rjc  10 Nov 2003 - increase MAX sizes for MAX.WORK.LIST, MAX.LIST.LEN
EQUATE MAX.WORK.LIST.LEN$ TO 32768
*EQUATE MAX.WORK.LIST.LEN$ TO 1048576 ; * 2^20, 1MB -- a compromise between unlimited list and well-framed lists file
EQUATE MAX.SORT.KEY.LEN$ TO 32600
*** rjc * EQUATE MAX.LIST.LEN$ TO 65527
EQUATE MAX.LIST.LEN$ TO  1048576 ; * 2^20, 1MB -- a compromise between unlimited lsit and well-framed lists file
EQUATE MAX.LIMIT$ TO 9E99            ;* WHAT TO SET LIMIT TO TO AVOID LIMIT

* SELECT MODE NUMERIC CODES *

EQUATE COMPAT.SELECT$ TO 0
EQUATE SETTING.SELECT$ TO 1
EQUATE USING.SELECT$ TO 2
EQUATE ASSIGN.SELECT$ TO 3

* REDUCE MODE NUMERIC CODES *

EQUATE NEW.REDUCE$ TO 0
EQUATE SETTING.REDUCE$ TO 1
EQUATE AND.REDUCE$ TO 2
EQUATE OR.REDUCE$ TO 3

* SEEK MODE NUMERIC CODES *

EQUATE TOP.SEEK$ TO 0
EQUATE BOTTOM.SEEK$ TO 1
EQUATE CURRENT.SEEK$ TO 2
EQUATE MARK.SEEK$ TO 3
EQUATE RESTORE.SEEK$ TO 4

* FIELD POSITIONS FOR NEXT.GROUP *
* GROUP.LAST$:
* USED BY ALL SELECT MODES. IN INDEX MODE IS THE LAST NODE ID FOR CURRENT LIST
* GROUP.FIELD$:
* IN EXTRA LIST INDEX MODE IS THE FIELD NUMBER OF THE CURRENT LIST IN MEMORY
* GROUP.FIRST$:
* IN INDEX MODE IS THE FIRST NODE ID FOR THE CURRENT LIST IN MEMORY
*
EQUATE GROUP.LAST$       TO 1
EQUATE GROUP.FIELD$       TO 2
EQUATE GROUP.FIRST$       TO 3

* FIELD POSITIONS FOR LONG.LIST *
* USED IN EXTERNAL SELECT MODE AND BREAK SORT INDEX MODE *
* THE INDEX OF THE CURRENT OVERFLOW LIST IN THE LISTS FILE *
*
EQUATE LONG.LIST.NUMBER$ TO 1
*
* THE LARGEST INDEX OF THE OVERFLOWS IN THE LISTS FILE *
EQUATE LONG.LIST.MAX$ TO 2

* CODES FOR LIST.ACTIVE *
EQUATE INACTIVE.SELECT$      TO 0
EQUATE LATENT.FILE.SELECT$   TO 1
EQUATE LATENT.INDEX.SELECT$  TO 2
EQUATE EXTRN.SELECT$         TO 3

* CODES FOR READNEXT DIRECTION *
EQUATE ASND.TERM$            TO 0
EQUATE ASND.NONTERM$         TO 1
EQUATE DSND.TERM$            TO 2
EQUATE DSND.NONTERM$         TO 3

* SECONDS ALLOWED BETWEEN BREAKS WHILE IN READNEXT *
EQUATE BREAK.TIME$           TO 10

EQUATE V119.INITIALIZE$      TO 'I'
EQUATE V119.SORT$            TO 'S'
EQUATE V119.WRITE$           TO 'W'
EQUATE V119.EXTRACT$         TO 'E'
EQUATE V119.MERGE$           TO 'M'
EQUATE V119.LONG.EXTRACT$    TO 'L'
EQUATE V119.DELETE$          TO 'D'

*** CURSORS ARRAY EQUATES ***

EQUATE MAX.CURSORS$           TO 8
EQUATE MAX.CURSOR.ELEMENTS$  TO 12

EQUATE CURS.LIST$            TO 1      ;* referenced by number in OP118
EQUATE CURS.LIST.OFF$        TO 2      ;* referenced by number in OP118
EQUATE CURS.EXT.LIST$        TO 3
EQUATE CURS.NEXT.GROUP$      TO 4
EQUATE CURS.LIST.ACTIVE$     TO 5
EQUATE CURS.LONG.LIST$       TO 6
EQUATE CURS.QUERY.DICT$      TO 7
EQUATE CURS.PRI.FILE$        TO 8
EQUATE CURS.REDUCTION.SPEC$  TO 9
EQUATE CURS.SORT.SPEC$       TO 10
EQUATE CURS.REDUCTION.DONE$  TO 11     ;* refereced by number in OP118
EQUATE CURS.IO.PROC$         TO 12     ;* Cursor I/O process

EQUATE BY.DSND.FLAG$         TO '#'    ;* FLAG FOR SELECT BY FIELD NAMES

* CODES FOR SORT.SPEC FIELD 1 *
EQUATE SORT.DIR$             TO 1
EQUATE SORT.JUST$            TO 2
EQUATE BOTTOM.VAL$           TO 3
EQUATE TOP.VAL$              TO 4
EQUATE SORT.NAME$            TO 5

* CODES FOR BY.LIST FIELD 1 *
EQUATE BY.F1.NAME$           TO 1
EQUATE BY.F1.BOTTOM$         TO 2
EQUATE BY.F1.TOP$            TO 3

* SORT.SPEC DEFINES *

EQUATE SORT.BYS$ TO 2         ;* FLAG TRUE IF DESCEND
EQUATE SORT.FMTS$ TO 3        ;* 'AL' 'AR'
EQUATE SORT.MULT$ TO 4        ;* FLAG TRUE IF MULTI-VALUE
EQUATE SORT.CALC$ TO 5        ;* VALUE TRUE IF FIELD IS SYMBOLIC
EQUATE SORT.FIELDS$ TO 6      ;* FIELD NAMES OR NUMBERS
EQUATE SORT.EXPLODE$ TO 7     ;* ANY MULTI-VALUES
EQUATE SORT.ID.ONLY$ TO 8     ;* SORTING ONLY BY @ID

* REDUCTION.SPEC DEFINES *
EQUATE REDUCT.SCRIPT$     TO 1   ;* R/LIST WITH SCRIPT
EQUATE REDUCT.SPEC.RANGE$ TO 2   ;* RANGE INFO FOR FEED FORWARD TO SELECT
EQUATE RANGE.FIELD$ TO 1
EQUATE RANGE.BOTTOM.VAL$ TO 2
EQUATE RANGE.TOP.VAL$ TO 3
EQUATE REDUCT.DONE$ TO 4
EQUATE REDUCT.CASE.FORCE$ TO 3   ;* FIELD 3 FORCE CASE FLAG (INSENSITIVITY)
*
* IF REDUCT.DONE IS TRUE THEN, IF THE RANGE IS USED BY THE SELECT THEN
* THAT WILL SATISFY ALL REDUCTION AND REDUCTION.DONE MAY BE SET TO TRUE

*** SELECT.SEEK STATUS ERROR CODES ***
EQUATE SEEK.ERR.BAD.CURS$    TO 1      ;* INVALID CURSOR
EQUATE SEEK.ERR.BAD.MODE$    TO 2      ;* INVALID MODE
EQUATE SEEK.ERR.BAD.POS$     TO 3      ;* INVALID POSITION
EQUATE SEEK.ERR.NO.SEL$      TO 4      ;* NO ACTIVE SELECT
EQUATE SEEK.ERR.BAD.SEL$     TO 5      ;* INVALID SELECT MODE
EQUATE SEEK.ERR.BAD.RN$      TO 6      ;* ERROR IN READNEXT
EQUATE SEEK.ERR.BAD.BRN$     TO 7      ;* ERROR IN BLOCK READNEXT
EQUATE SEEK.ERR.BAD.IRN$     TO 8      ;* ERROR IN INDEX READNEXT
EQUATE SEEK.ERR.BAD.ERN$     TO 9      ;* ERROR IN EXTERNAL READNEXT

* saved select header info (@tm-delim'd)
equ SAVSEL_TIMEDATE$   to 2
equ SAVSEL_USER$       to 3
equ SAVSEL_RECCOUNT$   to 4
equ SAVSEL_COMMENTS$   to 5

* placeholder for inverting for null vlues
Equ NULL_TOKEN$ To "%%NULL%%"

