Command Reference 5-33
DEFINE
Purpose Defines the field definitions for the buffers.
Syntax To define a SCRATCH buffer...
DEFINE field-type , field-length , data-type
To define TEMPORARY or PRINTER buffers...
DEFINE field-type , field-name , field-length [ , data-type ]
To define an ARRAY buffer...
DEFINE field-type , field-name , field-length , number-of-elements [ , data-type ]
To define a LOOKUP buffer...
DEFINE field-type , [ logical-name ] field-name , field-length [ , data-type ]
Process The DEFINE command defines temporary, lookup, printer, array, and scratch buffer
fields.

Field-type

can be one of the following:

Buffer Field

Description
INPUT Input Buffer
Logical Field Name
(TEMP1)
Temporary Buffer
Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name
(Field1) [Index]
Array Buffer Field
SCRATCH Scratch Buffer

Field-name

is the field's logical name and is under the same restrictions as any
other identifier.

Field-length

is the buffer field's size in bytes. Enter a value from 1 to 2800. If
you're defining a scratch buffer, the maximum is 65535.
NOTE: Although individual lookup table fields can be up to 2800 bytes long, lookup table
records cannot exceed 128K.
If a DEFINE TEMPORARY statement is placed inside the BEGIN-END pair of a
function, that variable can only be referenced within that function and not by any
other function.
Optional Fields

Logical-name

is used to define multiple lookup tables. Each name must be unique
(over all lookup tables used by the script) and in parentheses. The default name is
lookup.

Number-of-elements

is required when the

field-type

is set to ARRAY.

Data-type

is the kind of data the buffer field holds. Enter A (for alphanumeric) or N
(for numeric). The default is A.
NOTE: If

field-type

is PRINTER,

data-typ

e must be A.