HSAM and SHSAM database

HSAM and SHSAM databases share the following record formats.

Segment Formats

The following figure shows the DL/I data record formats for HSAM and SHSAM databases.

Figure 1. HSAM and SHSAM segment format
Graphic shows HSAM and SHSAM segment formats: HSAM graphic is a 3 column, 1 row rectangle. The first column is labeled "SEG. CODE" and is 1 byte. The second column is labeled "DEL. FLAG" and is 1 byte. The third column is labeled "DATA." Graphic also shows that "SEG. CODE" and "DEL. FLAG" are the prefix area of the segment. "DATA" is the data area of the segment. SHSAM graphic is the words "NO PREFIX" in parenthesis followed by a rectangular box labeled "DATA."
Delete Byte (Flag) Format
The following figure shows the delete byte (flag) format.
Figure 2. Delete byte (flag) format
Graphic shows a 8 column, 1 row table. Each column represents a bit and is labeled from left to right from 0 through 7. Graphic also indicates that all 8 bytes together equal 1 byte.
Bit
Description
0
Segment deleted (HISAM or index).
1
DB record deleted (HISAM or index).
2
Segment processed by DELETE.
3
Reserved.
4
Data and prefix are separated in storage.
5
Segment has been deleted on its physical path.
6
Segment has been deleted on its logical path.
7
Segment space available to be freed; bits 5 and 6 must also be set on.
Block Format for HSAM and SHSAM
There are no dependent segments in a SHSAM block. Block size must be a multiple of segment size. The following figure shows the block format for HSAM and SHSAM.
Figure 3. Block format for HSAM and SHSAM
Graphic shows three separate rectangles labeled "BLOCK 1," "BLOCK 2," and "BLOCK 3." Block 1 is represented by a 5 column, 1 row table. The first column (from left to right) is labeled "ROOT SEG." Columns 2, 3, and 4 are labeled "DEPND. SEG." The fifth column is labeled "000" and contains "(2)" referencing note 2 below. Block 2 is represented by a 5 column, 1 row table. The first column is labeled "DEPND. SEG." The second column is labeled "ROOT" and contains "(3)" referencing note 3 below. Columns 3, 4, and 5 are labeled "DEPND. SEG." Block 3 is a 2 column, 1 row table. The first column is labeled "DEPND. SEG." The second column is labeled "00000" and contains "(4)" referencing note 4 below.
Notes:
1.
Pad with zeros if no room for next segment.
2.
Next database record starts immediately.
3.
Pad with zeros in last block, after last segment.