Page 210 - DCAP310_INTRODUCTION_TO_ARTIFICIAL_INTELLIGENCE_AND_EXPERT_SYSTEMS
P. 210
Introduction to Artificial Intelligence & Expert Systems
Notes is updated. You tell COBOL the name of the prime key data item in the RECORD KEY clause of
the file-control paragraph.
In addition, each record in an indexed file can contain one or more embedded alternate key data
items. Each alternate key provides another means of identifying which record to retrieve. You
tell COBOL the name of any alternate key data items on the ALTERNATE RECORD KEY clause
of the file-control paragraph.
!
Caution The key used for any specific input-output request is known as the key of reference.
An indexed file contains records ordered by a record key. Each record contains a field that
contains the record key. The record key uniquely identifies the record and determines the
sequence in which it is accessed with respect to other records. A record key for a record might be,
for example, an employee number or an invoice number.
An indexed file can also use alternate indexes, that is, record keys that let you access the file
using a different logical arrangement of the records. For example, you could access the file
through employee department rather than through employee number.
The record transmission (access) modes allowed for indexed files are sequential, random, or
dynamic. When indexed files are read or written sequentially, the sequence is that of the key
values.
11.2.3 Hashed Files
Computer security is an important aspect for most businesses. Many organizations use a process
of hashing data into hash files to encrypt important data. Hash data is a numerical representation
of data and is not easy for a human to interpret. A hash file is a file that has been converted into
a numerical string by a mathematical algorithm. This data can only be understood after it has
been unencrypted with a hash key.
The process of hashing is the mathematical conversion of a string of characters into a smaller
value that is typically called a hash key. This new value represents the original character string
after it has been encrypted. Hashing is often used in databases as a method of creating an index.
Because hashed values are smaller than strings, the database can perform reading and writing
functions faster.
Notes Hash files are commonly used as a method of verifying file size. This process is
called check-sum verification. When a file is sent over a network, it must be broken into
small pieces and reassembled after it reaches its destination. In this situation, the hash
number represents the size of the data in a file. The hash can then be used as a tool for
validating the entire file was successfully transmitted over the network.
Hash functions are mostly used to accelerate table lookup or data comparison tasks such as
finding items in a database, detecting duplicated or similar records in a large file, finding
similar stretches in DNA sequences, and so on.
They represent one-way algorithms with a predefined size. If there was a decryption to hash
functions, we would have a reversible function which is not available in this scenario. However,
if there was, we would have the following. We know that the length could be any. Take a file
with 1024 TB in size and parse it through a hash function. We get a block of [i]N (say N is 64 bits)
204 LOVELY PROFESSIONAL UNIVERSITY