ENCRIBE
ENCRIBE
ENCRIBE
Features on ENSCRIBE
Has five file structures.
Has two formats; 1 & 2.
Partitioned files; also called as multiple-volume files.
Relational access among files.
Optional automatic maintenance of all keys.
Optional key compression in key sequenced data or index
blocks.
Optional compression of audit checkpoints records.
Record locking and file locking facilities.
Cache buffering.
Optional sequential block buffering.
Disk File Organization:
A file can be created in two ways.
- using FILE_CREATE_ procedure
- using FUP CREATE command.
You should also specify the file type when u create a
file.
A file can be designated as Temporary or
Permanent.
CONTROL-21 procedure call is used by the
application process to allocate one or more extents as well
as to de-allocate the unused extents.
Unstructured Files:
- a large byte array.
- usually a code file or edit file; not data file.
- data’s in the file is accessed by the relative byte
address(RBA), RBA is an offset from the first byte in the
file which is zero.
File:
A collection of related records, which are physically
organized as a number of extents.
Sector:
The smallest unit of disc I/O or physical addressing. (512
bytes in length)
Extents:
A unit of storage allocation in a file, which is contiguous
space on disc. (2048 byte pages).
Block:
Unit of physical I/O. Contains one or more logical record
plus some control information about the records. It is specified
as no. of bytes. (512, 1024, 2048, 4096).
Key:
A value associated with a record and which is used to
uniquely identify the record in the database or in a file.
Structure Files:
- four type of structure files: Key sequenced, Entry
sequenced, Queue, Relative files.
- Data transfer b/n files and the process is done in terms
of logical records and records keys.
- These files are created using several TANDEM softwares
like DDL, ENFORM and ENABLE.
Partitioned Files:
- max no. of extents in partitioned file is 16 extents.
- a file can reside entirely in one or more volumes.
- up to 16 partitions are allowed with each up to 16
extents.
- entire file is open using FILE_OPEN_ procedure.
- the file system rejects any attempts to open the secondary
partition unless unstructured access is specified.
- can accommodate more locks, can reside in multiple
caches which can result in fewer disk access.
- all partitions has to be either audited or not audited, they
can’t be mixed. MAXEXTENTS and Vol. Name are only things in
which they can differ. Primary & secondary partitions can differ
within same partition.
Access Coordination:
- it specifies which operations are to be performed on a file.
- it specifies read/write, read only or write only access to a
file.
- exclusion mode specifies how much access is granted to
other process.
- exclusion mode are shared, exclusive or protected.
- both access mode and exclusion mode are applied to the
file from the time it is opened to it is closed.
- two locking mode are provided: - File and Record
locking.
- Locking provides concurrent access to a disk file for short
period of time.
- Loading Files:
- FUP is used to load files into ENSCRIBE software.
- “loading factor”, it determines how much free space
to leave within the block.
- Manipulating Records:
- manipulation of records in a file is done using “Record
Management Functions” like WRITEUPDATE, WRITE, READ,
KEYPOSITION and etc.
Error Numbers:
0 = (CCE) No error.
File Code:
- file code are assigned while creating a file.
- it is used to categorize file according to the kind of information
they contain.
- you can assign an arbitrary numeric file code.
- default file code is “0”, 100 to 999 are reserved for system.
File Creation:
The following are the parameters for creating a file:
File Code:
Disk extents size.
Audit check-point compression.
Write verification.
Format of files (whether format 1 or format 2).
File Format:
Format 1: A logical record can be up to (Block size - 34 Bytes)
long.
Format 2: A logical record can be up to (Block size – 56 Bytes)
long.
Primary Keys:
- When u specify a primary, u need to give the “OFFSET” and
the LENGTH of the key field.
File Creation:
The following types of KSF files can be created.
- Key sequenced file.
- Key sequenced with alternate keys.
- Key sequenced format 2 with alternate keys.
- Alternate key file.
- Partitioned key sequenced file.
Blocking Factor:
Blocking factor decides how many records will be stored in the
block of block size you specified.
N = (block-size – 32) / (record-size + 2)
For Format 2:
N = (block-size – 44) / (record-size + 4)
Locking Mode:
Normal mode: It is the default locking mode. Any attempt
to lock the file which is locked by different file number, or
any attempt to alter it, is suspended unless the existing
lock is released.
Reject mode: Similar to above, but instead of suspending it
throws an error &#.
Read-through Normal mode: Data can only be read
through but cannot be altered.
Read-through Reject mode: Similar to above statement.
Read Warn Normal Mode and Read Warn Reject Mode:
Through a warning code of 9 when reading that locked
record or file.
File Locking:
File level locking is done using the procedure call
LOCKFILE and UNLOCKFILE.
Record Locking:
Record level locking is done using LOCKREC, READLOCK
and READUPDATELOCK.
Unlocking is done using UNLOCKREC.
Generic Locking:
Using generic locking “sets of records within the key
sequenced file whose key start with the same character
sequence can be locked”.
Done using SETMODE 123 procedure call.
Deadlocks:
Occurs when multiple process require multiple records
locks or file lock at the same time.