Segment 0 (Zero) of the File

When a KEYEDIO file is created, the following information about the file is saved in segment 0 of the file. Words in segment 0 are specified as offsets from the standard block information area at the start of every block. Since the block information area is currently 10 words long, word 0 of segment 0 is actually located at word 10 of the block.

Word 0

Describes the physical characteristics of the file. The values stored in this word are calculated at file creation time based on your file declarations and space requirements needed for maintaining the file.

Field

Meaning

[47:08]

The offset into the recovery area where the contents of the new record are stored for recovery of a rewrite operation.

[39:08]

The default number of buffers to allocate when this file is opened. This default is established by the setting of the BUFFERS attribute when the file was created.

[31:16]

The size of the records contained in the file in words. This value might be different from your declared MAXRECSIZE because of relative keys. If your program has specified relative keys, the record size is adjusted to allow relative keys.

[15:16]

The block size of the file in words. This value is different from the user's declared block size.

Word 1

Contains information about the keys and the program that created the file. This word is copied directly from the FILEINFO [0] parameter in ISAMOPEN at file creation time.

Field

Value

Meaning

[47:04]

 

File format level (currently 1)

[43:04]

 

Status of file

 

0

Closed

 

1

Open input

 

2

Open output

 

3

Open input/output

 

9

Locked

[39:08]

 

Language of program opening the file; same values as in the MCP language table.

[31:04]

 

Type of access to use on file

 

0

Sequential

 

1

Random

 

2

Dynamic

[27:01]

Deleted record flag

 

0

Deleted records are not visible

 

1

Deleted records are visible

[26:01]

Presence of relative keys

 

0

No relative keys

 

1

Relative keys

[25:01]

Record units

 

0

Words

 

1

Characters

[15:08]

Relative index into FILEINFO of first key of first key attribute (in words)

[19:04]

Record length flag

 

0

Fixed

 

1

Variable

[07:08]

 

Number of keys

Word 2

Specifies the timestamp of the last update. The timestamp is used in recovery. The current value of TIME (6) is stored in this word whenever the file is about to be updated. Every block that is written because of the update contains this timestamp. Refer to “Recovery Procedures” in this section.

Word 3

Specifies the segment that describes the keys—the key information table as follows:

Field

Meaning

[39:20]

Length of the key information

[19:20]

Relative segment number of key information block

Word 4

Not currently used.

Word 5

Specifies the first block in the file that has never been used. All blocks beyond the specified one are available for use.

Word 6

Specifies the next available record slot. When a record is added, the new record is stored at the location specified by this word.

Field

Meaning

[43:24]

The relative segment number of the current block

[19:20]

The offset into the block of the next record location

Word 7

Specifies the last user record to be updated. This word is only valid if nonzero. (Refer to “Recovery” in this section.)

Field

Meaning

[47:04]

The type of update in process

[43:24]

The relative segment number of the last updated block

[19:20]

The offset into the block of the last updated record

Word 8

The next relative key to be allocated. If relative keys have been specified, this word contains the next relative key value to be allocated.

Word 9

The MINRECSIZE value specified when the file was created.

Word 10

The MAXRECSIZE value specified when the file was created.

Word 11

The BLOCKSIZE value specified when the file was created.

Word 12

The FRAMESIZE value specified when the file was created.

Word 13

The BLOCKSTRUCTURE value specified when the file was created.

Word 14

The UNITS value specified when the file was created.

Word 15

The EXTMODE value specified when the file was created.