Rules for Naming User Defined Elements
ENFORM Language Elements
3–8
058057 Tandem Computers Incorporated
The primary key for files with key-sequenced file structure is a field within the record.
For key-sequenced files, referencing the primary key using the form record-name.KEY
is the same as explicitly naming the field described as the primary key. The advantage
of the form record-name.KEY is that you do not have to know the name of the primary
key field in order to reference it. A listing of the primary key values of the parts file
can be obtained by:
OPEN parts;
LIST parts.KEY;
The record with the primary key value of 1403 can be referenced by:
WHERE parts.KEY = 1403
For files with relative file structure, the primary key is a record number. The record
number is the ordinal position of the record relative to the beginning of the physical
file. The first record in the physical file has position zero. A listing of the primary
keys of a relative file can be obtained by:
OPEN rell;
LIST KEY OF rell;
The primary key of the fifth record in the file can be referenced by:
WHERE KEY OF rell = 4
Remember, the fifth record in a file with relative file structure has position four
because the first record has position zero.
For entry-sequenced and unstructured files, the primary key is a record address—the
byte address of the record’s block plus the relative record number within the block. A
record address is always an even number. For more information about file structures,
consult the ENSCRIBE Programming Manual.
A listing of the primary keys of an entry-sequenced file can be obtained by:
OPEN entryseq;
LIST entryseq.KEY;
The third record in the file entryseq has a primary key whose byte offset is 16. The
record can be referenced by:
WHERE entryseq.KEY = 16
For more information about file structures, refer to the ENSCRIBE Programming
Manual.
Summary of Contents for ENFORM 058057
Page 6: ...New and Changed Information 058057 Tandem Computers Incorporated v...
Page 18: ...Preface xvi 058057 Tandem Computers Incorporated This page left intentionally blank...
Page 19: ...Preface 058057 Tandem Computers Incorporated xvii...
Page 269: ...Glossary Glossary 4 058057 Tandem Computers Incorporated This page left intentionally blank...