RBC Induction - Proprietary and Confidential
ADABAS Adaptable DAta BAse System
RBC Induction - Proprietary and Confidential
CONTENTS
Day-1 Database Concepts ADABAS Overview ADABAS Architecture
Day-2 Fields & Descriptors Accessing ADABAS Data Protection/Security
Day-3 ADBAS Nucleus ADAPREP commands
Day-4– ADABAS programming
Day-5– Test the knowledge
RBC Induction - Proprietary and Confidential
MODULE - 1
Database Concepts
RBC Induction - Proprietary and Confidential
Database Concepts
A data base is not really anything new. It is just a concept, or a way of organizing data and software, to solve some of the problems found in conventional file processing.
The data base concept solves the problems of– Duplication of data and effort.– Programmers needs to know the exact file structure.– People looking at files to which they should not have
access.– Programs needs to be changed when the data is
organized differently.– Dynamic Reporting structure
RBC Induction - Proprietary and Confidential
Database Goals
Data bases are used to meet 4 main data- related goals
– Increase Data Independence– Reduce Data Redundancy– Increase Data Security– Maintain Data Integrity
RBC Induction - Proprietary and Confidential
Database Goals
INCREASE DATA INPENDENCE
INDEPENDENT FILE SYSEM
PROGRAM - A
PROGRAM - B
In database processing, the data and the programs are INDEPENDENT. A change in the data organization will NOT USUALLY affect the user programs. If the format of the data is changed or re-organized, the programs dependant on that data must be changed. For example, if you need three lines for an address instead of two, the data would have to be changed as well as the programs. Bottom line is users should not worry how the data is actually stored. Instead, they can focus on the particular part of data they want to access with an application program.
RBC Induction - Proprietary and Confidential
Database Goals
REDUCE DATA REDUNDANCY In a conventional file system, the same data may be stored in many different files to
meet the requirements of different applications. Thus some of the data is unnecessarily repeated (redundant).
For example in conventional File processing system Customer address is repeatedly found in
CUSTOMER RECORDS SYSTEM (CRS) PURCHASE ORDER SYSTEM (POS) ACCOUNTS RECEIVABLE SYSTEM (ARS)
This redundancy could cause problem when customer address changes. The address must be changed in each of the files causing duplication of effort and more opportunities of errors.
So it is better for different application systems to share same centralized database thus avoiding
the data redundancy. POS
ARS
CENTRALIZEDDATA BASECRS
RBC Induction - Proprietary and Confidential
Database Goals
INCREASE DATA SECURITY Most databases have security features which authorize access to the data
and place restrictions on the operations that may be performed on the data.
– Eg: You may be allowed to read particular data, but not update it.– Eg: Only certain people may be allowed to look at salary data.
RBC Induction - Proprietary and Confidential
Database Goals
MAINTAIN DATA INTEGRITY
Maintaining accuracy (integrity) of the data is very important in a database system because the database is shared by many users.
Without integrity, the data could end up to be invalid or unreliable. Everyone who uses the database, from programmer to DBA, is responsible
for integrity of data.
RBC Induction - Proprietary and Confidential
Database Goals
As per understandings the four main goals of Database system are: INCREASE INDEPENDENCE REDUCE REDUNDANCY MAINTAIN DATA INTEGRITY INCREASE DATA SECURITY
RBC Induction - Proprietary and Confidential
Types of Databases
There are three types of data base management systems
– HIERARCHICAL– NETWORK– RELATIONAL
RBC Induction - Proprietary and Confidential
Database Types
HIERARCHICAL Database
HIGH SCHOOL
STUDENT
REPORTS
REGISTARTION
COMMENTSCOURSES
DEGREES
Each Segment is directly dependent on one segment only
RBC Induction - Proprietary and Confidential
Database Types
HIERARCHICAL Database In a Hierarchical database…
– There is always a basic or "root" segment.– A segment may relate downwards to one or more subordinate segments; these
subordinates are referred to as "child" segments.– A subordinate (child) segment may relate upward to only one superior or
"parent" segment.
RBC Induction - Proprietary and Confidential
Database Types
NETWORK Database
PERSON VEHICLE
COMPANY
BUILDING
CLUB
Here data is organized so that the PERSON segment is directly dependent on both COMPANY and CLUB.Segments are equivalent to records in flat file structures.
RBC Induction - Proprietary and Confidential
Database Types
NETWORK Database
In a network database structure . . .– segments are related to one another as superiors and subordinates.– A segment may relate downwards to one or more subordinates.– A segment may relate upwards to one or more superiors. This is what
distinguishes a network structure from a hierarchical structure.– A network database structure can be considered an expansion of the
hierarchical structure
RBC Induction - Proprietary and Confidential
Database Types
RELATIONAL Database
SSN # DOB DEPT SexEmployee Record
DEPT Dept Name
Designation
TimingsKey Field
In a Relational Database, fields in one record type are used to point to other record types
DEPT Record
RBC Induction - Proprietary and Confidential
Database Types
ADABAS Database Which type of data base management system do you think ADABAS is
closest to?
RELATIONAL
RBC Induction - Proprietary and Confidential
MODULE - 2
ADABAS Overview
RBC Induction - Proprietary and Confidential
ADABAS - Overview
Adabas is a high-performance database for large, mission-critical applications. It is specifically designed to support thousands of users in parallel while giving sub-second response times.
Its legendary reliability in combination with its low cost of ownership makes it a first-choice database for any mission-critical business application
Some Key Features– Relational and nested data structures – Native and SQL access – Built-in transaction concept – Minimal space consumption – Built-in utilities – Automated DBA tasks– Add-on products for special requirements, such as Text retrieval – Distributed computing – Web support – Administration
RBC Induction - Proprietary and Confidential
ADABAS - Overview
Adabas is available for a wide range of platforms, including Windows NT, UNIX, Open VMS and mainframe.
Access to Adabas– Adabas can be accessed from Natural, Software AG’s 4GL development
environment,– Bolero, Software AG’s application factory, and from every 3GL and 4GL that is
equipped with a call interface. – In addition, Adabas can be accessed via standard interfaces such as ODBC or
JDBC and, of course, embedded SQL can be used
RBC Induction - Proprietary and Confidential
ADABAS Overview
RBC Induction - Proprietary and Confidential
ADABAS Overview
The Size of an Adabas Database– On the mainframe there is no size limit at all– On open-systems platforms the theoretical limit for Adabas databases is 128 TB -
a figure limited in practice only by the amount of hard disk space that can be made available
– Mainframe ADABAS supports around 65535 databases. Each Database in turn contains FILES (maximum 5000). A FILE can contain around 4 Trillion records and each record is collection of fields. Field is the last undivided level where data is stored. Each record can have maximum 926 fields
RBC Induction - Proprietary and Confidential
Features of ADABAS
Inverted lists are used to define relationships in the data Adabas is very flexible database management system Can produce many different views for various users In ADABAS, information can be logically interconnected (or related) through
the use of INVERTED LISTS The inverted lists are lists of addresses for each record, and there is one
inverted list for every key field in every ADABAS dataset. (A file is referred to as a dataset.)
Because relationships are defined in the keys, ADABAS is very FLEXIBLE or ADAPTABLE
The name ADABAS reflects it’s flexible structure ADAPTABLE DATA BASE SYSTEM ADABAS
RBC Induction - Proprietary and Confidential
Database Overview
What is Inverted List ? The inverted lists are lists of addresses or ISN (Internal Sequence Number)
numbers for each record, and there is one inverted list for every key field in every ADABAS dataset.
In Adabas , information can be logically inter connected through the use of Inverted lists.
Example Of Automobile Database Let's see an example of how inverted lists provide a flexible system for
keeping data.LICENSE TYPE MODEL COLORBDX 205 FORD TAURUS BLACKCHS 499 OLDS CUTLASS REDAMC 372 CHEVY MALIBU REDKEN 007 PORSHE 928 BLACKBPS 076 OLDS SUPREME BLUEMPM 644 FORD TEMPO RED
RBC Induction - Proprietary and Confidential
Database Overview
How ISN is supplied by Adabas There are no key fields defined in the data. ADABAS assigns an Internal
Sequence Number (ISN) to each record for searching purpose
ISN LICENSE TYPE MODEL COLOR1 BDX 205 FORD TAURUS BLACK2 CHS 499 OLDS CUTLASS RED3 AMC 372 CHEVY MALIBU RED4 KEN 007 PORSHE 928 BLACK5 BPS 076 OLDS SUPREME BLUE6 MPM 644 FORD TEMPO RED7 .. .. .. ..8 .. .. .. ..
RBC Induction - Proprietary and Confidential
Database Overview
What is a Descriptor When Key is defined, nothing is changed in the data, Instead an inverted
list is built for that key (Descriptor). Which field you want to describe as Descriptor LICENSE TYPE MODEL COLOR Inverted List Based on LICENSE
DESCRIPTOR COUNT ISN’sAMC 372 1 3BDX 205 1 1BPS 076 1 5CHS 499 1 2KEN 007 1 4MPM 644 1 6.. .. .... .. ..
RBC Induction - Proprietary and Confidential
Database Overview
Inverted List based on TYPEDESCRIPTOR COUNT ISN’sCHEVY 17 3,8,14,34..FORD 29 1,6,17,23,..OLDS 42 2,5,19,20,..PORSHE 2 4,57,..... .. .... .. ..
DESCRIPTOR COUNT ISN’s928 2 4,57,...CUTLASS 4 2,20,46,47,..MALIBU 17 3,8,34,63,..SUPREME 6 5,19,38,42TAURUS 13 1,17,32,40..TEMPO 10 6,23,28,37.... .. .... .. ..
Inverted List based on MODEL
RBC Induction - Proprietary and Confidential
Database Overview
Features of ADABAS Another feature of ADABAS is the ability to produce many different views
of the data (using PREDICT / NATURAL) Advantages of User Views are -
– Provides security for confidential data– Provides simple views to the users– Eliminates unnecessary information being presented– Data Compression Allows data to be stored efficiently– Security Facilities Provided for confidentiality of data
RBC Induction - Proprietary and Confidential
Database Overview
Data Compression ADABAS has an option to store data on the disk in a compressed form. This
option saves disk space and reduces I/O.
– leading zeros are removed from numeric fields– trailing spaces are removed from alphanumeric fields– null value fields are compressed to a single byte– numeric data is packed
Compression reduces data storage almost by 50% Secure Data ADABAS maintains data security in four ways: Dataset Level:
• An entire dataset can be password protected to allow no access, or read-only access, or update access for different security levels.
Field Level:• An individual field can be protected from unauthorized access or
unauthorized updating. Up to 15 security levels can be set for a field
RBC Induction - Proprietary and Confidential
Database Overview
– Security by Value• Access to a file can be restricted by the value of the field. For example,
managers could be restricted to personal information of employees in only their own department.
– Ciphered Data• Records can be ciphered or encrypted when information is highly
confidential. A ciphering key is entered by the user when records are stored. It must be entered again to access the data.
RBC Induction - Proprietary and Confidential
ADABAS Environment
ADABAS can operate in one of two environment
– Multi-User– Singe-User
Multi-User• This is the normal operation of a data base where many people in an
organization are reading, updating, adding and deleting data simultaneously.
ADABAS DATABASE
Operating System
ADABAS Nucleus---------------------------
MPM
Application - 2Application - 1
Multi Processing Module
Batch program
Online program
RBC Induction - Proprietary and Confidential
ADABAS Environment
Single UserThis mode can be used when there is huge amount of processing (like
rearranging theentire database). This could be done at night when no one else wants to use
Adabas.
ADABAS DATABASE
Operating System
ADABAS Nucleus
Application - 1Application - 2
RBC Induction - Proprietary and Confidential
Learning Objective
In this module you have learnt:
_ Advantages of a data base system _ Three types of data bases _ ADABAS features _ ADABAS environment
RBC Induction - Proprietary and Confidential
MODULE - 3
ADABAS Architecture
RBC Induction - Proprietary and Confidential
Main components of ADABAS
Associator
Work
Data
ADABAS Database
RBC Induction - Proprietary and Confidential
Main components of ADABAS
Associator
Work
Data
ADABAS Database
Operating System
ADABAS NucleusMPM
Application 1 Application 2
RBC Induction - Proprietary and Confidential
ASSOCIATOR
This dataset contains
– A list of all ADABAS datasets in the database– Physical location of datasets (by block number)– Descriptions of all fields of each ADABAS dataset in the Field Description Table– Inverted lists for each descriptor– ADDRESS CONVERTER for relative record locations
A second important component of the Associator is the Address Converter
– The Address Converter is an index to the physical storage location of the records, giving the physical block in which each record is stored.
– There is one Address Converter for every dataset in the database.
RBC Induction - Proprietary and Confidential
Address Converter
To understand how the Address Converter works, we need to know how the data records are organized
– The records are not necessarily stored sequentially by ISN– The records are grouped and stored in blocks on the disk and indexed by
Relative ADABAS Block Numbers (RABNs - pronounced like “Robin”)
RBC Induction - Proprietary and Confidential
Inverted List & Address Converter
ISN LICENSE MAKE COLOR2 MAP 199 FORD ORANGE9 BLY 409 DODGE MAROON6 MBP 526 HONDA MAROON: : : :11 XOX 000 PONTIAC ORANGE3 LNC 128 CHEVY BLUE1 CHS 710 FORD BLUE: : : :4 BDX 205 MERCURY GREEN7 FMT 931 HONDA BLUE5 SRA 101 OLDS GREEN: : : :
BLOCK 1
BLOCK 2
BLOCK 3
RBC Induction - Proprietary and Confidential
Inverted List & Address Converter
DESCRIPTOR COUNT ISNsBLUE 17 1,3,7,12,..GREEN 14 4,5,14,18,..MAROON 19 6,8,9,13,..ORANGE 2 2,11,..
ADDRESSCONVERTER
ISNs
212331341724
123456789101112
The Address Converter is ordered sequentially by ISN in this example: ISN#1 is in RABN 2 ISN#2 is in RABN 1 ISN#3 is in RABN 2 etc..
For an efficient search for the ISNs, the Address Converter is used
RBC Induction - Proprietary and Confidential
WORK Dataset
This dataset is used to keep data protection information that is required for automatic restarts and backouts after a system failure
It acts as a type of working scratch-pad area for ADABAS
Associator
Work
Data
Data Protection Information
-----------------------------------Temporary ISN list storage
-----------------------------------
Resulting ISN lists
– Besides storing DATA PROTECTION INFORMATION, the WORK dataset acts as temporary storage during a SEARCH command. The WORK dataset also acts as temporary storage for ISN lists
– When ADABAS is finding records for you, it uses the WORK dataset for intermediate results
– Only partial or incomplete transactions are kept track of here. A log of the commands is not kept in the WORK dataset
RBC Induction - Proprietary and Confidential
DATA Dataset
Data records are stored in the DATA dataset– In random order– compressed to save disk space– organized into fixed length blocks on disk
The DATA dataset contains the physical data stored in FIXED SIZE BLOCKS
DATA
WORK
Inverted List Address Converter Block 1
ASSOCIATOR
Block 2
Block 3
RBC Induction - Proprietary and Confidential
ADABAS - Logs
After knowing the datasets let’s see the two optional logs of ADABAS These are
– COMMAND LOG– PROTECTION LOG
The Command Log keeps a record of every command that goes through the ADABAS nucleus
– This log gives a basis for billing those who use the system– The log gives the valuable information for performance tuning– This log is also used for application program debugging
The Protection Log contains before and after images of any records that are updated, deleted, or added between checkpoints
– It is used for regeneration of the database• (eg. After a disk crash)
– It is also used for backing out of a job– It is used for keeping an audit trail
RBC Induction - Proprietary and Confidential
ADABAS Database Organization
After knowing the ADABAS environment , let’s see the organization of data in the database
We will look at – Datasets– Records– Fields
An ADABAS database is made up of up to 255 data datasets (files) An ADABAS file can have up to 16.7 million records An ADABAS record can have up to 926 fields Some special grouping fields in ADABAS are
– MU fields (Multiple Value fields)– PE groups (Periodic group of fields)
These are like arrays within the records– MU fields are 1- dimensional arrays– PE fields are 2- dimensional arrays
RBC Induction - Proprietary and Confidential
MU/PE fields example
MU fields This is a single dimensional array where ADABAS allows us to store multiple
values in that particular field. For example let’s look at the following typical employee record
If now we need Rajeev’s record of positions before his attaining the current Consultant designation we may use an MU Field to store this informationRajeev Sharma Consultant
Assc Const
Asst Const
M.E 87%
This designation field constitutes an MU Field. The maximum numbers of occurrences supported are 191.
RBC Induction - Proprietary and Confidential
MU/PE Fields
Rajeev
ConsultantAssc ConsAsst Cons
M.E DL3CM9998
DL3C4115
2005
1999
ALTO
Zen
04/11/200804/11/200704/11/200604/11/2005
09/09/200109/01/200009/01/1999
87%
PE FieldsPE is a group of fields that repeat together in a record. A PE field can consist of elementary fields as well as Multiple Value fields. For example I want to store the following details about car-Car Number-Model-Type-Servicing Dates All this information can be stored in a PE field consisting of elementary fields as Number, Model and Type and a Multiple Value field Service Date. A PE field can store up to 191 occurrences. Maximum of 99 PE group occurrences per PE
RBC Induction - Proprietary and Confidential
MU/PE Fields
When should PE groups or MU fields be used?– When you have user views that relate directly to one of the other user views in a
one-to-many relationship Databases with PE groups are more inflexible, acting more like a
hierarchical than relational One should have a good reason for using PE groups (I.e. If you want all
occurrences of the PE group that relate to a record every time you access
RBC Induction - Proprietary and Confidential
Learning Objective
In this module you have learnt:
_ The three types of ADABAS datasets _ Two optional logs in ADABAS _ Data file architecture _ MU and PE repeating fields
RBC Induction - Proprietary and Confidential
MODULE - 4
Fields &
Descriptors
RBC Induction - Proprietary and Confidential
Data Organization
ADABAS Data Base
1 - 255 Datasets
0 - 16.7 million records
1 - 926 fields
RBC Induction - Proprietary and Confidential
ADABAS Fields
ADABAS keeps track of field-related information in the Field Definition Tables (FDT) Here is some of the information that is kept: _ ADABAS field name _ Format _ Level _ Length _ Type of compression _ Type of field Data Format of fields Data in an ADABAS is in one of the 6 following formats, each with a one
letter code
F Fixed point binary 4 bytesP Packed numeric 15 bytesU Unpacked numeric 29 bytesA Alphanumeric 253 bytesB Binary 126 bytesG Floating point 8 bytes
RBC Induction - Proprietary and Confidential
Data Format of fields
The information about each field in the database is kept in the FDT (Field Definition Table)
Sample information of FDT looks like ...
External Field Name--------------------------This is the name that would be used for a field in an application program
EMPLOYEE-NONAME LAST-NAME FIRST-NAME DEPARTMENT
ADABAS Field Name--------------------------This is a two byte alphanumeric code that ADABAS will use to lookup the field
A1 A2 A3 A4 BB
RBC Induction - Proprietary and Confidential
FDT Information
Level--------------------------The level of the fields as ina PL/I declaration or a COBOL data division
01 01 02 02 01
Format-----------------------This indicates the typeof data in the field
P
A A P
Length--------------------------The standard length of thefield in bytes
4
16 16 10
RBC Induction - Proprietary and Confidential
DATA Compression
ADABAS uses special compression techniques to• Conserve disk space• Reduce Input/Output• Increase performance
Field compression can be set in one of three different waysFI -- Fixed field with no compression Default -- Compression of individual fieldsNU -- Null suppression uses special
techniques to make compressioneven greater than the default
RBC Induction - Proprietary and Confidential
Data Compression
Special Length bytes are added to the record when compressed
================================================================================= ¦ ¦ FI ¦ ¦ Default ¦ ¦ NU ¦
================================================================
¦ ¦ ¦ No length bytes ¦ ¦ A length byte is ¦ ¦ One byte is use¦
¦ ¦ ¦ are added. ¦ ¦ added at the ¦ ¦ to count empty ¦
¦ ¦ ¦ ¦ ¦ start of every ¦ ¦ fields. ¦¦ ¦ ¦ ¦ ¦ field. ¦ ¦ ¦¦ ¦ ¦ ¦ ¦ ¦ ¦ Fields with data ¦¦ ¦ ¦ ¦ ¦ ¦ ¦ in them have a ¦¦ ¦ ¦ ¦ ¦ ¦ ¦ length byte ¦¦ ¦ ¦ ¦ ¦ ¦ ¦ added. ¦================================================================================
RBC Induction - Proprietary and Confidential
DATA Compression
+-----------------------------------------------+ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ B ¦ A ¦ R ¦ B ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ +-----------------------------------------------+
This is a fixed alphanumeric field for "First Name".
Default or NU compression would add a length byte and remove trailing spaces.
+-------------------+ ¦ The length of ¦ ¦ ¦ ¦ ¦ ¦ ¦ '5' counts the ¦ 5 ¦ B ¦ A ¦ R ¦ B ¦ ¦ characters and ¦ ¦ ¦ ¦ ¦ ¦ ¦ includes itself. +-------------------+
Compression of this field saved 7 bytes from a 12 byte field!
RBC Induction - Proprietary and Confidential
DATA Compression
3 2 S A M S
This is a 16 byte alphanumeric field for an address. 9 3 2 S A M S The compressed field look like above
RBC Induction - Proprietary and Confidential
DATA Compression
The following is an example of a compressed numeric field.
+---------------------------+ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ 0 ¦ 0 ¦ 0 ¦ 2 ¦ 8 ¦ 4 ¦ 6 ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ +---------------------------+
This is a standard unpacked numeric field for "Employee Number".
+-------------------------------------------------------+ ¦ Default or NU compression would store this as packed, ¦ ¦ remove the leading zeroes and add a length byte. ¦ +-------------------------------------------------------+ ________________________________________________________ +---------------+ ¦ ¦ 0 ¦ 8 ¦ 6 ¦ ¦ 4 ¦ 2 ¦ 4 ¦ C ¦ +---------------+ This 7 byte field is compressed into only 4 bytes. The 'C' on the end indicates the sign
of the number (positive).
RBC Induction - Proprietary and Confidential
DATA Compression
J E R R Y 0 0 0 0 0 0 0 0 0 2 8 4 6 1 2 3 4 This record has 4 empty fields After compression it will look like 6 J E R R Y 5 0 4 4 0 3
4 02 84 6C
There is still wasted space that could be eliminated using NU compression
RBC Induction - Proprietary and Confidential
DATA Compression
Under NU compression it looks like
6 J E R R Y C4 4
02846C
The count indicates 4 empty fieldsDefault compression saves 50%NU compression saves 75%
RBC Induction - Proprietary and Confidential
DESCRIPTORS
In ADABAS, a key field is called a DESCRIPTOR , abbreviated to DE An ADABAS file may have up to 200 descriptors. These descriptors may be
defined when the dataset is initially created, or at a later time using the ADAINV utility
ADABAS has 5 types of DESCRIPTORS– Regular Descriptors– Super Descriptors– Sub Descriptors– Phonetic Descriptors– Hyper Descriptors
Regular Descriptor: A regular descriptor is a regular field that can be used for search criteria. Example:
– In a file of employee records, the employee number would likely be defined as a regular descriptor
A special feature of regular descriptors is the UNIQUE DESCRIPTOR option. This ensures that there will be only one occurrence of each value in the data base
dataset. Example:
– If all employee numbers are to be unique, the unique descriptor option could be used for the employee number field.
RBC Induction - Proprietary and Confidential
Super Descriptor
A super-descriptor is a concatenated or compound key, consisting of from 2 to 5 elements. These elements can come from other fields, from parts of other fields, or from combinations of whole and partial fields.
Super-descriptors may not exceed 253 bytes in length Example:
– In an employee data base, a search using "LAST NAME" will not always find a unique record
By using a super-descriptor combination of "LAST NAME", "FIRST NAME", and "BIRTH DATE", a search should always find a unique record
If the users of the data base often search by two factors (for example, price of FORD cars with SUPREME model), a super-descriptor combination of "MAKE" and "MODEL" will make this combination search efficient
Super descriptors can be made up of any combination of descriptors or non-descriptors
Up to 5 whole fields or parts of fields can be made as Super descriptor
RBC Induction - Proprietary and Confidential
Sub Descriptor
A Sub descriptor is a partial field that is used as a descriptor Example:
– An automobile repair shop may stock parts. The part numbers may be contained in one field yet contain more than one piece of information.
Part Number G85404003871Car manufacturer (GM) Year of car (85)Model of car (Delta 88)Part type (Hubcap)
Phonetic descriptors make use of a phonetic algorithm built into ADABAS. You can look up alphanumeric fields with "sounds-like" searching criteria.
– Example: • If sales personnel wanted to look up their customer records without knowing
how to spell the customer's name, they could use a phonetic descriptor.
RBC Induction - Proprietary and Confidential
Phonetic Descriptor
– The telephone companies use a phonetic descriptor for looking up names and phone numbers in directory assistance.
Hyper Descriptors Hyper-descriptors enable descriptor values to be generated based on a
user-supplied algorithm. – Example:
• If sales personnel wanted to look up customer records in reverse collating sequence in terms of latest sales date, they could use a hyper-descriptor.
RBC Induction - Proprietary and Confidential
Compression effects
Compression of records has an effect on the inverted lists built for each descriptor.
For regular descriptors, null suppression will not find records when a search is conducted for a zero value or a blank value.
No entry is made in the inverted list for a null value field under NU compression
The effects of NU compression for regular descriptors also applies to sub-descriptors and phonetic descriptors.
Further, the NU compression also affects super-descriptors. If any component of a super-descriptor is a zero or a blank under NU
compression, the ISN for that record will not be listed in the inverted list Here is how to handle this:
– If zero or blank values may be meaningful in a descriptor field, use default compression.
– If zero or blank values are definitely not meaningful, it is fine to use NU compression
RBC Induction - Proprietary and Confidential
Learning Objective
In this module you have learnt:
_ Contents of the Field Descriptor Table _ Compression effects on fields
_ Five types of descriptors _ Compression effects on descriptors
RBC Induction - Proprietary and Confidential
MODULE - 5
AccessingADABAS
RBC Induction - Proprietary and Confidential
ADABAS Constraints
– Maximum of 255 files per data base.– Maximum of 16.7 million records per file.– 4816 byte maximum compressed record length.– Up to 926 fields per record.– 253 byte maximum field length (alpha).– Maximum of 99 PE group occurrences per PE.– Maximum of 191 MU values per MU field.– Maximum of 200 descriptors per file.– Up to 5 fields or parts of fields in a Super Descriptor
RBC Induction - Proprietary and Confidential
ADABAS Accessing
You may access data in an ADABAS database using one of two approaches
Sequential Approach– Physical Order– ISN Order– Logical Order
Random Approach– Simple Find– Sorted Find– Complex Find– Getting by ISN
RBC Induction - Proprietary and Confidential
SEQUENTIAL Approach
Sequential access is done by using READ commands
READ PHYSICAL– In this method sequential access is to read in the physical order that the records
are stored Physical Order - READ PHYSICAL
ISN EMPNO LASTNAME
FIRSTNAME
DEPT
1 01037 HARRIS JILL PROD7 15429 BULWARK KEN ACCT5 66725 GUNNER DOUG PROD3 41180 CONCH TERRY ADMIN6 31622 WU MATT MIS4 09331 HOYTE BRIAN PROD
Employee Dataset
VALUE COUNT ISN’sACCT 30 2,7,17,19,.ADMIN 14 3,8,11,14,.MIS 7 6,10,18,34,.PROD 52 1,4,5,9,.
Inverted List for Dept
RBC Induction - Proprietary and Confidential
Physical Order - READ PHYSICAL
A READ PHYSICAL command will read the records in the order in which they are stored in the dataset.
So the records will be read in this order: 1 7 5 3 6 4 . . .
READ Physical
The first method for sequential access is to read in the physical order that the records are stored. A READ PHYSICAL command will read the records in the order in which they are stored in the dataset.
Example :EMPLOYEE Dataset+-------------------------------¦ ¦ ¦ LAST ¦FIRST¦¦ISN¦EMP. NO¦ NAME ¦NAME ¦ DEPT+---+-------+-------+-----+-----¦ 1 01037 ¦HARRIS ¦JILL ¦ PROD¦ 7 ¦ 15429 ¦BULWARK¦KEN ¦ ACCT¦ 5 ¦ 66725 ¦GUNNER ¦DOUG ¦ PROD¦---+-------+-------+-----+-----¦ 3 ¦ 41180 ¦CONCH ¦TERRY¦ ADMI¦ 6 ¦ 31622 ¦WU ¦MATT ¦ MIS| 4 ¦ 09331 ¦HOYTE ¦BRIAN¦ PROD¦---+-------+-------+-----+-----¦ : ¦ : ¦ : ¦ : ¦ :
So the records will be read in this order:1 7 5 3 6 4
RBC Induction - Proprietary and Confidential
ISN Order - READ by ISN
A second method for sequential access is to read in the order of the ISN. A READ by ISN will retrieve the records in ISN order So the records will be read in this order:
1 2 3 4 5 6 7 . . READ BY ISN :A second method for sequential access is to read in the
order of the ISN A READ by ISN will retrieve the records in ISN order The records will be read in this order: 1 2 3 4 5 6 . . .
RBC Induction - Proprietary and Confidential
Logical Order - READ LOGICAL
The third method for sequential access is to read in the order of ISNs of the Inverted Lists
A READ LOGICAL will retrieve records in the order of listing in one of the Inverted Lists
A READ LOGICAL by DEPT will be in this order 2 7 17 19 . . . 3 8 11 14 . . The third method for sequential access is to read in the order of ISNs listed in one of the Inverted Lists. A READ LOGICAL will retrieve
records in the order of listing in one of the Inverted Lists. A READ LOGICAL by DEPT will be in this order: 2 7 17 19 . . . 3 8 11 14 . .
RBC Induction - Proprietary and Confidential
RANDOM Approach
Random access is done by using the following commands– FIND
• Simple• Complex• Sorted
– GET• Using a specific ISN
FIND - SimpleEmployee Dataset +------------------------------- Inverted List for DEPT. ¦ ¦ ¦ LAST ¦FIRST¦ +------------------------- ¦ISN¦EMP. NO¦ NAME ¦NAME ¦ DEPT ¦VALUE ¦COUNT¦ ISNs +---+-------+-------+-----+----- +------+-----+------------ ¦ 1 ¦ 01037 ¦HARRIS ¦JILL ¦ PROD ¦ACCT ¦ 30 ¦2,7,17,19... ¦ 7 ¦ 15429 ¦BULWARK¦KEN ¦ ACCT ¦ADMIN ¦ 14 ¦3,8,11,14... ¦ 5 ¦ 66725 ¦GUNNER ¦DOUG ¦ PROD ¦MIS ¦ 7 ¦6,10,18,34.. ¦---+-------+-------+-----+----- ¦PROD ¦ 52 ¦1,4,5,9..... ¦ 3 ¦ 41180 ¦CONCH ¦TERRY¦ ADMI +------------------------- ¦ 6 ¦ 31622 ¦WU ¦MATT ¦ MIS ¦ 4 ¦ 09331 ¦HOYTE ¦BRIAN¦ PROD If a simple FIND command is given ¦---+-------+-------+-----+----- ¦ : ¦ : ¦ : ¦ : ¦ : FIND ALL RECORDS WITH DEPT = ADMIN the following ISNs would be selected: 3 8 11 14 . . .
RBC Induction - Proprietary and Confidential
FIND - Complex
Complex FINDs involve searching based on more than one descriptor. Complex FINDs involve more processing.
– EXAMPLE:• FIND ALL RECORDS WITH EMPNO < 50000 AND DEPT = PROD
ISNs where ISNs where EMPNO < 50000 DEPT = PROD
::::::::::::::::::
::::::::::::::::::
::::::::::::::::::
A list of the selected ISNs is produced for each search parameter given. The lists are then merged into one list where both conditions are true.
RBC Induction - Proprietary and Confidential
FIND – Complex
Inverted List for DEPT. Employee Dataset+------------------------- +-------------------------------¦VALUE ¦COUNT¦ ISN's ¦ ¦ ¦ LAST ¦FIRST¦+------+-----+------------ ¦ISN¦EMP. NO¦ NAME ¦NAME ¦ DEPT¦ACCT ¦ 30 ¦2,7,17,19... +---+-------+-------+-----+-----¦ADMIN ¦ 14 ¦3,8,11,14... ¦ 1 ¦ 01037 ¦HARRIS ¦JILL ¦ PROD¦MIS ¦ 7 ¦6,10,18,34.. ¦ 7 ¦ 15429 ¦BULWARK¦KEN ¦ ACCO¦PROD ¦ 52 ¦1,4,5,9..... ¦ 5 ¦ 66725 ¦GUNNER ¦DOUG ¦ PROD+------------------------- ¦---+-------+-------+-----+----- ¦ 3 ¦ 41180 ¦CONCH ¦TERRY¦ ADMI Inverted List for EMPNO. ¦ 6 ¦ 31622 ¦WU ¦MATT ¦ MIS+------------------------- ¦ 4 ¦ 09331 ¦HOYTE ¦BRIAN¦ PROD¦VALUE ¦COUNT¦ ISN's ¦---+-------+-------+-----+-----+------+-----+------------ ¦ : ¦ : ¦ : ¦ : ¦ :¦01037 ¦ 1 ¦ 1¦09331 ¦ 1 ¦ 4 Which ISN's would be selected by the command:¦15429 ¦ 1 ¦ 7 FIND ALL RECORDS WITH EMPNO < 50000 AND DEPT=PROD¦31622 ¦ 1 ¦ 6
¦41189 ¦ 1 ¦ 3 1,4¦66752 ¦ 1 ¦ 5+-------------------------
RBC Induction - Proprietary and Confidential
Let's see the ISN's selected by the command ...
FIND ALL RECORDS WITH EMPNO < 50000 AND DEPT = PROD.
ISN's with ISN's with DEPT = PROD EMPNO < 50000 +---------+ +-----------+ ¦ 1 ¦ ¦ 1 ¦ These 2 lists ¦ 4 ¦ ¦ 4 ¦ will be ¦ 5 ¦ ¦ 7 ¦ produced as ¦ 9 ¦ ¦ 6 ¦ intermediate ¦ : ¦ ¦ 3 ¦ results. ¦ : ¦ +-----------+ +---------+ This final list is a combination of the above two intermediate ISN lists. +-----+ ¦ 1 ¦ ¦ 4 ¦ +-----+
RBC Induction - Proprietary and Confidential
Inverted List for Color Automobile Dataset +------------------------------ +------------------------------ ¦ VALUE ¦ COUNT ¦ ISN's ¦ISN ¦LICENCE ¦ MAKE ¦COLOR ... +--------+-------+------------- +----+-------+-------+--------- ¦ BLUE ¦ 17 ¦ 1,3,7,12 ... ¦ 2 ¦MAP 199 ¦FORD ¦ORANGE ¦ GREEN ¦ 14 ¦ 4,5,14,18 .. ¦ 9 ¦BLY 409 ¦DODGE ¦MAROON ¦ MAROON ¦ 19 ¦ 6,8,9,13 ... ¦ 6 ¦MBP 526 ¦HONDA ¦MAROON ¦ ORANGE ¦ 2 ¦ 2,11 ¦ : ¦ : ¦ : ¦ : ¦----+-------+-------+--------- Inverted List for Make ¦ 11 ¦XOX 000 ¦PONTIAC ¦ORANGE +------------------------------ ¦ 3 ¦LNC 128 ¦CHEVY ¦BLUE ¦ VALUE ¦ COUNT ¦ ISN's ¦ 1 ¦CHS 710 ¦FORD ¦BLUE +--------+-------+------------- ¦ : ¦ : ¦ : ¦ : ¦ CHEVY ¦ 24 ¦ 3,5,11,13... ¦----+-------+-------+--------- ¦ DODGE ¦ 10 ¦ 9,17,23,28.. ¦ 4 ¦BDX 205 ¦MERCURY ¦GREEN ¦ FORD ¦ 32 ¦ 1,2,4,12.... ¦ 7 ¦FMT 931 ¦HONDA ¦BLUE ¦ HONDA ¦ 8 ¦ 6,7,8,29.... ¦ 5 ¦SRA 101 ¦OLDS ¦GREEN ¦ : ¦ : ¦ : ¦ : Which ISN's would be selected by the command:
FIND ALL RECORDS WITH MAKE=FORD AND COLOR=BLUE
RBC Induction - Proprietary and Confidential
Inverted List for Color +------------------------------ +------------------------+ ¦ VALUE ¦ COUNT ¦ ISN's ¦ To determine the +--------+-------+------------- ¦ selected ISN's, pick ¦ ¦ BLUE ¦ 17 ¦ 1,3,7,12 ... ¦ the ISN's where ¦ ¦ GREEN ¦ 14 ¦ 4,5,14,18 .. ¦ COLOR = BLUE then ¦ ¦ MAROON ¦ 19 ¦ 6,8,9,13 ... ¦ pick the ISN's where ¦ ¦ ORANGE ¦ 2 ¦ 2,11 ¦ MAKE = FORD . ¦ +------------------------+ Inverted List for Make +------------------------------ --------------------------- ¦ VALUE ¦ COUNT ¦ ISN's The ISN’s that match in +--------+-------+------------- these 2 lists are 1 and 12 ¦ CHEVY ¦ 24 ¦ 3,5,11,13... --------------------------- ¦ DODGE ¦ 10 ¦ 9,17,23,28.. ¦ FORD ¦ 32 ¦ 1,2,4,12.... ¦ HONDA ¦ 8 ¦ 6,7,8,29....
Which ISN's would be selected by the command: FIND ALL RECORDS WITH MAKE=FORD AND COLOR=BLUE
RBC Induction - Proprietary and Confidential
RANDOM Approach
A simple FIND involves little processing or I/O A complex FIND takes much more processing and I/O since intermediate steps are involved A FIND with SORT is very expensive command using even more processing and I/O
– Eg:• FIND ALL RECORDS WITH COLOR > GREEN SORTED BY LICENSE
FIND - with SORT Inverted List for Color
+------------------------------ ¦ VALUE ¦ COUNT ¦ ISNs FIND ALL RECORDS WITH COLOR = MAROON +--------+-------+------------- SORTED BY MAKE in desc. ¦ BLUE ¦ 17 ¦ 1,3,7,12 ... ¦ GREEN ¦ 14 ¦ 4,5,14,18 .. will first select all the ISNs where ¦ MAROON ¦ 19 ¦ 6,8,9,13 ... COLOR = MAROON. ¦ ORANGE ¦ 2 ¦ 2,11
Inverted List for Make +--------------------------------+ +------------------------------ ¦ Then a search through the MAKE ¦ ¦ VALUE ¦ COUNT ¦ ISNs ¦ inverted list will find any ¦ +--------+-------+------------- ¦ matches. ¦ ¦ CHEVY ¦ 24 ¦ 3,5,11,13... +--------------------------------+ ¦ DODGE ¦ 10 ¦ 9,17,23,28.. _________________________________ ¦ FORD ¦ 32 ¦ 1,2,4,12.... ¦ HONDA ¦ 8 ¦ 6,7,8,29.... The final list of ISNs produced would be:
13 9 6 8
RBC Induction - Proprietary and Confidential
GET - Using a specific ISN
GET using specific ISN is the last method for accessing ADABAS records in random order
This can be used to access specific records where the ISN is already known In some ADABAS data bases the ISNs are given extra meaning.
– For example: The ISNs could be used as the 5-digit employee number in a Personnel data base. Then instead of using a command like
• FIND ALL RECORDS WITH EMPNO = 23845 you could use a command like
• GET ISN 23845 . By setting up the data base this way, disk space is saved. (One field is
saved in the dataset) By using the GET command instead of a FIND, processing time and I/O will
be saved
RBC Induction - Proprietary and Confidential
ADABAS Accessing
Apart from the above ADABAS has other access command like– UPDATE– DELETE– ADD
ADABAS can be accessed with the following access facilities– DIRECT CALLS– ADABAS SQL– NATURAL– ADAPREP
RBC Induction - Proprietary and Confidential
ADABAS Accessing
DIRECT CALLS The Direct Calls from application programs use 2 character codes for commands Here are some commands used in direct calls
S1 - FINDL2 - READ PHYSICAL L3 - READ LOGICAL
N1 - ADD A NEW RECORDE1 - DELETE A RECORD
Using direct calls is like programming in a low-level language. With each command, control blocks and buffers must all be identified Because of the detail involved, direct calls are rarely used. Occasionally a
Systems Programmer may use direct calls for some special purposeADABAS SQL ADABAS SQL contains a subset of standard SQL, as well as extensions which are
not available within standard SQL. ADABAS SQL relieves the user from having to define the data base's data areas
manually, and takes over data transfer to the program data areas automatically.
RBC Induction - Proprietary and Confidential
ADABAS Accessing
NATURAL NATURAL is a powerful application programming language that is designed
for accessing ADABAS data bases. NATURAL commands are easy to understand and use. Here are some
examplesFIND UPDATEGET DELETEREAD
NATURAL programs can be either batch or on-line. NATURAL can also be used for simple ad-hoc inquiries, for reports, and for
complex programs updating, deleting and adding records. Programmers can save many lines of code using NATURAL instead of PL/I or
COBOL with ADABAS SQL or direct calls. NATURAL has automatic error handling built-in, and includes a user-friendly
development environment. A command to find ISNs that match certain criteria can be done in NATURAL,
ADABAS SQL, or by direct calls. NATURAL takes about 1 line of code. ADABAS SQL takes about 10 lines of code. Direct Calls take about 25 lines of code.
RBC Induction - Proprietary and Confidential
Learning Objective
In this module you have learnt: _ Sequential access logic _ Random access logic _ Direct Calls _ ADBAS SQL _ NATURAL
RBC Induction - Proprietary and Confidential
MODULE - 6
Data ProtectionSecurity
RBC Induction - Proprietary and Confidential
Data Protection
Data protection must be built into a Data Base Management System to ensure that the data base retains its integrity.
– Let's examine a situation where data integrity could easily be lost.• When preparing a packing slip on-line for items to be sent to a customer, the
customer record is accessed and many item records are accessed and updated
Packing Slip Transaction ____________________________ The packing slip transaction is only meaningful when all 1. Read customer record four physical transactions take place. 2. Access item A record, update inventory level 3. Access item B record, This group of transactions is update inventory level referred to as one logical transaction. 4. Access item C record, update inventory level __________________________________
Data Integrity loses If this logical transaction is not updated in database then
RBC Induction - Proprietary and Confidential
ET - END Transaction
An "End-Transaction" or "ET" statement is used with ADABAS to indicate the end of a logical transaction.
One application program may involve several logical transactionsET - How it takes place
+------------------------------------------------------+ ¦ As a logical transaction proceeds, changes are being ¦ ¦ made in the data base and in the work dataset. ¦ +------------------------------------------------------+ +-------------- +--------+ ¦ Logical ¦ FIND ¦ ¦ Transaction ¦ ¦ +-------------- ¦ UPDATE ¦ --------- Change in data base ¦ ¦ ¦ ADD ¦ --------- Change in data base ¦ ¦ ¦ DELETE ¦ --------- Change in data base ¦ ¦ ¦ FIND ¦ ¦ ¦ ¦ UPDATE ¦ --------- Change in data base ¦ ¦ ¦ ET ¦ --------- Make all changes +--------+ permanent.
RBC Induction - Proprietary and Confidential
ET - How it takes place
What would the effect be on the transaction if an ET did NOT occur? This situation may occur when:
– An operator does not complete entering a transaction.– A machine failure occurs.
BT - Back-out Transaction If an operator leaves part-way through a transaction, ADABAS will back-out
the transaction (BT)----------------------------------------------------------------- +-------------- ¦ ¦ ¦ Logical ¦ ¦ ¦ Transaction ¦ ¦ +------------------+ +-------------- ¦ FIND ¦ ¦ Back to original ¦ ______________ ¦ ¦ ¦ state of the ¦ ¦ UPDATE ¦ ¦ data base. ¦ ¦ ¦ +------------------+ ¦ ADD ¦ ¦ ¦ +---------------------+ ¦ - Operator leaves - ¦ +---------------------+ +------------------+ ______________ _______ ¦ BT ¦ +--------+ +------------------+ When the operator returns, the operator is informed that he/she was
backed-out
RBC Induction - Proprietary and Confidential
BT - Back-out Transaction
If a machine failure occurs, the back-out (BT) occurs automatically when the database is brought up again
When records are being updated the record is "held". This means that no other program can access that record for updating.(Use of this "hold" logic ensures accurate data integrity)
The third situation is when the transaction time limit is exceeded. If two programs request records that are being held by each other, a deadlock situation will occur.
When the transaction time limit is reached, the transaction will be backed out
A transaction may be backed out for one of three reasons we've discussed. – Machine failure – Non-activity time limit – Transaction time limit
RBC Induction - Proprietary and Confidential
PREDICT - Data Dictionary
ADABAS has a data dictionary called ....
PREDICT +--------------------------------------------------------------+ ¦ The dictionary maintains information about ¦ ¦ the data base, its datasets and fields. ¦ +--------------------------------------------------------------+ +--------------------------------------------------------+ ¦ Details kept about the fields include: ¦ ¦ _ name ¦ ¦ _ format ¦ ¦ _ length ¦ ¦ _ descriptor status ¦ ¦ _ repeating group information ¦ ¦ _ compression ¦ +--------------------------------------------------------+
RBC Induction - Proprietary and Confidential
What is the use of Data Dictionary
When a data base is first loaded, the elements of the datasets must be defined indicating the characteristics of each field.
– COBOL programs use the WORKING-STORAGE SECTION of the COBOL program to define variables used in the program.
– PL/I programs have DCL (declare) statements to define variables used in the programs.
– NATURAL programs use Data Definition Modules (DDMs) to define their variables. The data dictionary is used to store the definitions for the variables that
will be used in the COBOL, PL/I or NATURAL programs PREDICT can also be used to create reports cross-referencing fields,
datasets and programs
RBC Induction - Proprietary and Confidential
Data Security
ADABAS can provide security at many levels:– Dataset Level– Field Level– Security by Value in Field– Ciphered Datasets
All security is kept by a password system. Passwords are assigned to individuals or groups, and the password is associated with a certain security level.
RBC Induction - Proprietary and Confidential
The DBA sets the security level of each group of users of the data base. The levels of access and update privileges range from 0 (low) to 14 (high).
+---------------------------------------------------------------------------+ ¦ ACCESS/UPDATE LEVELS ¦ ¦--------------------------------------------------------¦ ¦ ¦ ¦ EMPLOYEE ¦ PROJECT ¦ AUTOMOBILE ¦ ¦ NAME ¦ PASSWORD ¦ DATASET ¦ DATASET ¦ DATASET ¦ ¦-----------+----------+----------+---------+---------------------------------------------------¦ ¦ J. BROWN ¦ HAT ¦ 14/8 ¦ 14/8 ¦ 10/5 ¦ ----+ ¦ S. STEELE ¦ STOL ¦ 10/6 ¦ 10/5 ¦ 14/9 ¦ ¦
| ¦ ¦ ¦ ¦ ¦ ¦ ¦
| +--------------------------------------------------------------
+ +----------------------------------------------+ ¦ ¦ +----------------------------------------------+ ¦ Sam Steele has access level ¦ ¦ ¦ From this table, what are Joan ¦ ¦ 10 for the employee dataset. He +--+ ¦ Brown's access and update levels ¦ ¦ has level 6 update privileges ¦ ¦ for the automobile dataset? ¦ ¦ on this file. ¦ ¦ ¦ +----------------------------------------------+ ¦ Access ¦ ¦ Update ¦ +---------------------------------------------------+
RBC Induction - Proprietary and Confidential
Learning Objective
In this module you have learnt:
_ Data Protection procedures _ Data Dictionary features _ Security features
RBC Induction - Proprietary and Confidential
MODULE - 7
ADABAS NUCLEUS
RBC Induction - Proprietary and Confidential
ADABAS Nucleus
For each ADABAS database there an ADABAS nucleus which resides in its own partition and responsible for all database requests by application programs
It handles control of concurrent access and update (online transactions), buffering of database records, back out and recovery in case of system crashes
ADABAS Buffers ADABAS maintains following buffers while accessing the database
CONTROL BLOCKSEARCH-BUFFERVALUE-BUFFER
FORMAT-BUFFER RECORD-BUFFERISN-BUFFER
RBC Induction - Proprietary and Confidential
ADABAS Buffers
CONTROL BLOCK– Contains Command-ID– Database and File-ID’s– Return codes
SEARCH BUFFER– Contains the names of the descriptors by which the search is made along with
the search criteria VALUE BUFFER
– Contains descriptor names used for search criteria– Value supplied dynamically for complex search
FORMAT BUFFER– List of the fields one wants to retrieve– Can be specified in any order
• (independent of physical location) RECORD BUFFER
– After retrieving the record the data values of the requested fields are kept here– Arranged in the order as specified in FORMAT buffer
ISN BUFFER– List of the ISN’s resulting from a successful FIND operation
RBC Induction - Proprietary and Confidential
ADABAS UTILITES
ADASAV A utility to dump database datasets onto tape or disk and retrieve them again. ADARES A utility to reapply or remove updates to the database using the protection log
facility. ADACMP A utility to compress and decompress the datasets. ADALOD A utility to load compressed data into database. ADAULD A utility to unload data from database to a dataset. ADAORD This utility has many options: Reorder the Associator for 1 or more datasets Reorder data storage for 1 or more datasets Unload 1 or more datasets for relocation to another device.
RBC Induction - Proprietary and Confidential
ADABAS UTILITIES
ADADBS To modify the characteristics of an ADABAS dataset, ADADBS may be used. Here are some: Delete a dataset Recover unused space in the data base Increase the size of a data base Rename or renumber datasets Change the length of a field Add new fields to the dataset Release a field from being a descriptor ADAINV The INVERT function of ADAINV creates a descriptor, sub descriptor, super descriptor, hyper descriptor, phonetic descriptor. ADAREP Which datasets are in database The size of each dataset Physical space usage Field definition table information
RBC Induction - Proprietary and Confidential
NATURAL
• NATURAL is a proprietary programming language developed and marketed by Software AG
• Applications developed using NATURAL are modular, which contributes to its success as a tool for Rapid Application Development
• A NATURAL program can execute in either batch or on-line mode, with full access to database files.
• In online mode, NATURAL programs can process user input in real-time.• In batch mode, NATURAL programs can read and write sequential (i.e. non-
database) files.
101
RBC Induction - Proprietary and Confidential
DESCRIPTION OF NATURAL STATEMENTS
• Data Definition• Data Access• Data Manipulation• Data Modification• Data Reporting• Loop Execution Statements• Screen Statements• Logical Check Statements• Routine Invoking Statements• File Control Statements
102
RBC Induction - Proprietary and Confidential
NATURAL STATEMENTS
DEFINE DATA ….. END-DEFINE
This statement along with its closing structure END-DEFINE explicitly defines the data area. It must be the first statement in a program. Only comment lines can be placed before DEFINE DATA statement. All fields (Database fields as well as user-defined variables) are defined in this statement The fields can be defined either inside the defined data segment or outside. When it is defined out side it is defined in 1.Local data area LDA 2.Global data area GDA 3.Paramater data area PDA
103
RBC Induction - Proprietary and Confidential
NATURAL STATEMENTS
1.Local data area LDA A local data area (LDA) defines data that becomes “local” to any module that uses the LDA.
2.Global data area GDA The term “global data” describes data that occupies space outside of
any executable module. Programs and external subroutines (including any in-line subroutines within them) have direct access to global data, whereas subprograms and help routines (including any in-line subroutines within them) do not.
3. Parameter data area PDA. The term “parameter data” describes data that is passed between a
subprogram and the “calling” module.
104
RBC Induction - Proprietary and Confidential
USER-DEFINED VARIABLES
Format Maximum length A = Alphanumeric 1-253
N = Numeric 1-29 (default = 7)
P = Packed Numeric 1-29 (default = 7)
I = Integer 1 or 2 or 4
B = Binary 1-126
C = Attribute Control 2
D = Date 6 (stored in 4 bytes)
T = Time 12 (stored in 7 bytes)
F = Floating point 4 or 8
L = Logical 1
105
RBC Induction - Proprietary and Confidential
USER-DEFINED VARIABLES
Variables Initialization:The default initial value for various formats is B,F,I,N,P 0A BlankL F(alse)D D''T T'00:00:00'C (AD=D)Used within the DEFINE DATA statement to indicate the structure and grouping of the definitions.–Relevant to view definitions, redefinition's and field groups.–Range from 1 to 9.–Generally, variable definitions are on level 1.–The level numbering in view definitions, redefinitions, and groups must be sequential. No level numbers may be skipped.–If you redefine a field, the REDEFINE option must be on the same level as the original field, and the fields resulting from the redefinition must be one level lower.
106
RBC Induction - Proprietary and Confidential
Group Fields
DEFINE DATA LOCAL1 #FIELDA (N2.2)1 #FIELDB (I4)1 #GEMP 2 #EMPNO (N5) 2 #BIRTH (D) 2 #EMPADDR (A10)1 #FIELDF (A2)….END-DEFINEUsed within the DEFINE DATA statement to indicate the structure and grouping of the
definitions.Relevant to view definitions, redefinition's and field groups.Range from 1 to 9.Generally, variable definitions are on level 1.The level numbering in view definitions, redefinitions, and groups must be sequential.
No level numbers may be skipped.If you redefine a field, the REDEFINE option must be on the same level as the original
field, and the fields resulting from the redefinition must be one level lower.
107
RBC Induction - Proprietary and Confidential
Group Fields
The fields #EMPNO, #BIRTH, EMPADDR are defined under the common group name #GEMP. #GEMP only serves as a group name and is not a field in its own and therefore does not have a format/length definition
ARRAYS Single dimensional array DEFINE DATA LOCAL 1 #ARRAY (A10/1:3) END-DEFINE
Multi dimensional array DEFINE DATA LOCAL 1 #ARRAY (A10/1:3,1:4) END-DEFINE
108
RBC Induction - Proprietary and Confidential
DATABASE VIEWS
DDM (Data Definition Module). For Natural to be able to access a database file, a logical definition of the
physical database file is required. Such a logical file definition is called a DDM (data definition module). A DDM contains the database-internal field name (which is a two letter mnemonic) as well as the "external" field name (English like names).
109
RBC Induction - Proprietary and Confidential
DATA ACCESS / MODIFICATION STATEMENTS
Various Statements used with Natural: READ FIND GET HISTOGRAM STORE UPDATE DELETEREAD READ is used to retrieve records from a database sequentially. READ & END-READ defines the
top & bottom of loop respectively Read physical In the order in which they are physically stored in the database Read logical==> preferred In the order of the values of a descriptor field Read by ISN In the order of Adabas Internal Sequence Numbers
110
RBC Induction - Proprietary and Confidential
READ
** Example 'READX01': READ ***********************************************************************
DEFINE DATA LOCAL 1 MYVIEW VIEW OF EMPLOYEES 2 NAME 2 PERSONNEL-ID 2 JOB-TITLE END-DEFINE * READ (6) MYVIEW BY NAME DISPLAY NAME PERSONNEL-ID JOB-TITLE END-READ END
111
RBC Induction - Proprietary and Confidential
FIND
The FIND statement is used to select a set of records from the database based on a search criterion consisting of fields defined as descriptors (keys). Various relational operators like (EQ, GT, LT, LE, GE, NE) or (=, >, >=, <, <=, =) are used along with clause to filter the records
************************************************************************ DEFINE DATA LOCAL 1 MYVIEW VIEW OF EMPLOYEES 2 PERSONNEL-ID 2 NAME 2 JOB-TITLE 2 CITY END-DEFINE * FIND MYVIEW WITH CITY = 'PARIS' WHERE JOB-TITLE = 'INGENIEUR COMMERCIAL' DISPLAY NOTITLE CITY JOB-TITLE PERSONNEL-ID NAME END-FIND END
112
RBC Induction - Proprietary and Confidential
GET
A GET statement presents a single record for processing when the ISN is known. Unlike READ and FIND, there is no associated processing loop
DEFINE DATA LOCAL 1 EMPLOY-VIEW VIEW OF EMPLOYEES 2 NAME 2 SALARY (1) END-DEFINE * RD. READ EMPLOY-VIEW BY NAME DISPLAY EMPLOY-VIEW IF SALARY (1) > 1500000 /* GE. GET EMPLOY-VIEW *ISN (RD.) /* WRITE '=' (50) 'RECORD IN HOLD:' *ISN(RD.) COMPUTE SALARY (1) = SALARY (1) * 1.15 UPDATE (GE.)
113
RBC Induction - Proprietary and Confidential
STORE
STORE inserts/adds one record to a database file. One has to populate the data fields with relevant values of the record before STORing it with the file.
DEFINE DATALOCAL 1 #CLIENT-ID (N8) 1 #CNAME (A20) 1 RECEVIEW VIEW OF RECEIVABLE 2 CLIENT-ID 2 CNAME END-DEFINE INPUT #CLIENT-ID #CNAME RECEVIEW .CLIENT-ID := #CLIENT-ID RECEVIEW .CNAME := #CNAME STORE RECEVIEW END TRANSACTION
114
RBC Induction - Proprietary and Confidential
UPDATE
UPDATE modifies one existing record with a database file. One has to select the particular record by using READ/FIND/GET statement before updating the record. If we READ/FIND a number of records before UPDATing one particular record, then all the records selected by READ/FIND get locked. To avoid this, GET can be used to select the record we want to update so that, only that record gets locked.
ExampleDEFINE DATA1 RECEVIEW VIEW OF RECEIVABLE 2 SALARYEND-DEFINERD1.READ RECEVIEW WHERE SALARY GT 10000IF SALARY EQ 14900GET-REC.GET *ISN(RD1.)ADD 100 TO RECEVIEW .SALARYUPDATE (GET-REC.)END-IFEND TRANSACTIONEND
115
RBC Induction - Proprietary and Confidential
DELETE
DELETE physically removes records from a database file. Before deleting the particular record, one has to select the record by using READ/FIND/GET statement.
DEFINE DATA 1 RECEVIEW VIEW OF RECEIVABLE 2 ACTIVE END-DEFINE GET-REC. READ RECEVIEW WHERE ACTIVE=FALSE DELETE (GET-REC.) END TRANSACTION END
116
RBC Induction - Proprietary and Confidential
HISTOGRAM
The HISTOGRAM statement is used to either read only the values of one database field, or determine the number of records which meet a specified search criterion.
DEFINE DATA LOCAL 1 MYVIEW VIEW OF EMPLOYEES 2 CITY END-DEFINE * LIMIT 8 HISTOGRAM MYVIEW CITY STARTING FROM 'M' DISPLAY NOTITLE CITY 'NUMBER OF/PERSONS' *NUMBER *COUNTER END-HISTOGRAM ENDRESULT: CITY NUMBER OF PERSONS CNT -------------------- ----------- ----------- MADISON 3 1 MADRID 41 2 MAILLY LE CAMP 1 3 MAMERS 1 4 MANSFIELD 4 5
117
RBC Induction - Proprietary and Confidential
Data Definition Module
09:05:06 ***** NATURAL LIST COMMAND ***** 2001-11-08 User M6919 - List DDM SHIPMENT - Library SYSTEM
DDM DBID 0 DDM FNR 66 VSAM Name Default Sequence Page 1
T L DB Name F Leng S D Remarks - - -- -------------------------------- - ---- - - ------------------------ G 1 JK SH-SHIPMENT-KEYS CONTAINS THE 4 BASIC 2 BK SH-BOOKING-NO A 9 N D S/L ASSIGNED RESERVA 2 ZP SH-FILLER-31 A 1 N 2 BL SH-BILL-NO-SHIPMENT-COUNT N 12.0 N D CONTAINS BILL OF LAD 2 CN SH-CONTAINER-NO A 10 N D IDENTIFIER OF A CONT 2 JG SH-SHIP-NO A 12 N D UNIQUE IDENTIFIER OF 2 OU EQP-CHK-DGT A 1 N ONE BYTE DIGIT DERIV P 1 QE SH-VVD-DEPENDENT-INFO CONTAINS INFO SPECIF 2 OP SH-OP-VVD-POL-POD A 68 N COMPOSITE FIELD ON S G 1 JL SH-SELECTION-GROUP DENOTES FIELDS THAT 2 RQ REQ-EQUIP-LTL-CANC A 19 N COMPOSITE FIELD ON S 2 ZQ SH-FILLER-32 A 1 N 2 DS SH-DEST-ORIGIN-AROT A 55 N COMPOSITIE FIELD ON Top of List. Command ===> Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Print Exit Long -- - + ++ Canc
RBC Induction - Proprietary and Confidential
Data Definition Module
T L DB Name F Leng S D Remarks
T - Type (Group, MU,PE ) L - Level DB - 2 byte ADABAS field name Name - Field name F - Data format Leng - Length of the field S - Storage compression type D - Descriptor usage Remarks - Field comments
RBC Induction - Proprietary and Confidential
NATURAL SCREEN PRINTS SAMPLE
120
Natural screen prints sample
RBC Induction - Proprietary and Confidential
THE END