737
*MEMORY*
Create & Use Memory File
Format
1. Create Memory-Resident Queue of Records: OPEN (chan[,fileopt])"*MEMORY*
2. Create Multi-Key File: OPEN (chan[,fileopt])"*MEMORY* [;KEYDEF=key_def$ ]"
Where:
chan
Channel or logical file number.
BSZ=num File option for specifying record size (number of bytes). The
fileopt
default is 1,024 bytes unless it is overridden via BSZ= .
key_def$
String expression defining the key. The key definition can be single-
or multi-keyed and may contain up to 96 segments for a total of 16
keys. Key names and the various attributes supported on VLR/FLR
files may also be included in the key definition.
*MEMORY* Keyword, not case-sensitive. Logical filename, enclosed in quotation
marks within OPEN directive. (Include asterisks in syntax.)
Description
ProvideX supports a memory-resident logical file called *MEMORY*. This file may
consist of a queue of records that can be accessed by index or by single key, or it
may be a multi-key file accessed by key, depending on the format used to create it.
Create the memory-queue file and assign the given logical file number (channel) via
the OPEN directive.
Use CLOSE (chan) to delete a *MEMORY* file and return memory to the system.
Format 1: Create Memory-Resident Queue of Records
OPEN (chan[,fileopt])"*MEMORY*
Use this format to create a memory-resident queue of records. ProvideX recognizes
*MEMORY* at run time and deals with it internally. Once *MEMORY* is open, you
can gain I/O access to memory-resident records in the same manner as you can to
Direct files (by record index or by key) using the following I/O directives:
The first WRITE determines the file access method; i.e., the IND= option specifies
Indexed file handling, and KEY= specifies Direct file handling (externally-keyed
files). The maximum key size for *MEMORY* files is 8192 characters. Adding records
to a *MEMORY* file by IND( ), pushes all the records at that index down one, and
inserts a new record. To modify a record in an index file, remove the old record and