ADABAS - PowerPoint PPT Presentation

About This Presentation
Title:

ADABAS

Description:

ADACMP SUPFN='GG=AA(1,4),AD(1,1)' Superfield GG. October 2006 ... 000036 * E.G. AA='GENERAL MOTORS'. October 2006. Dieter W. Storr -- info_at_storrconsulting.com ... – PowerPoint PPT presentation

Number of Views:1510
Avg rating:3.0/5.0
Slides: 77
Provided by: Dieter81
Category:
Tags: adabas | aa | adam | and | com | cons | pool | pros | table

less

Transcript and Presenter's Notes

Title: ADABAS


1
ADABAS
Little Known Features Natural Conference in
Philadelphia, PA October 17-20, 2006 Dieter W.
Storr info_at_storrconsulting.com
2
Content
  • ADAM Files
  • Hyperdescriptors
  • Coupling
  • Multi-client Files

3
ADAM
  • Adabas Direct Access Method
  • How it works
  • Performance issues
  • Read access
  • Write access

4
ADAM How to Create
ADACMP
ADAMER
REPORT
ADALOD ADAMFILE
ADAULD
ADABAS
ADABAS
5
ADAM
  • Measurements and evaluations
  • ADAMPARM
  • ADAMOFLOW
  • DSSIZE
  • I/Os with FINDs and value not found, key values
    -1 to -99
  • I/Os with hit rate 100 for ADAM and not ADAM
    descriptors
  • What happened if poor distribution of ADAM key
  • - Pros and Cons

6
ADAM
7
ADAMER Parameters
ERROR-076, Mandatory parameter MAXISN missing
8
ADAMER Parameters
  • ADAMDEUQ DE or ISN
  • No sub-, super-, hyper-, collation, or phonetic
    descriptor
  • No MU or PE field
  • No variable length field
  • No NU defined descriptor

9
ADAMER Parameters
  • BITRANGEX,Y,Z
  • Bit Truncation for ADAM Keys
  • X minimum
  • Y maximum
  • Z incremental

10
ADAMER Parameters
  • DATASIZEn1,n2,n3
  • Data Storage Size for Estimates
  • n1 min cylinders
  • n2 max cylinders
  • n3 increments
  • For example DATASIZE100,175,25

11
ADAMER LOAD
  • ADALOD LOAD FILExxx
  • ADALOD ADAMFILE ADAMDEfield ISN
  • ADALOD ADAMOFLOWsize
  • ADALOD ADAMPARMnumber 0
  • ltsnipgt

12
ADAMER LOAD
  • 163510 P R E D I C T 4.3.2
    2006-08-22
  • - Modify Adabas attributes -
  • File ID ......... TEST-BROY Added
    2005-02-28 at 1318
  • Contained in DA . TEST
    by M197/9
  • PDBnr ........... 200 PFnr ... 168



  • ADAM descriptor definition
  • Field ID ........
  • Parm .............
  • Overflow .........



  • Additional attributes .. S

13
ADAMER Disadvantages
  • ADAM key is not unique
  • Determine DS block with ADAM routine
  • Search DS block in buffer pool
  • DS block is not in buffer pool
  • DATA I/O to copy block into buffer pool
  • DS block not found
  • Access via normal descriptor in ASSO

14
ADAMER Disadvantages
  • ADAM key is not unique cont
  • Search ASSO block in buffer pool
  • ASSO I/O to copy block into buffer pool
  • Found DE with ISN?
  • NO record not found
  • YES read AC and translate ISN to RABN
  • AC is normally in buffer pool, no I/O

15
ADAMER Disadvantages
  • ADAM key is not unique cont
  • Access to DS overflow area
  • DS overflow area not in buffer pool
  • DATA I/O to copy block into buffer pool
  • Record is ready to be displayed

16
Hyperdescriptors
  • How it works
  • Hyperdescriptor Exits
  • What Approach
  • Pros and Cons

17
Hyperdescriptor Exit Nucleus
ADANUC
HyperDE Exit
ASSO
DATA
18
Hyperdescriptor Exits DDCARD
Assembler routines located on a concatenated
ADABAS load library.
  • ltsnipgt
  • ADARUN DUALPLS13500
  • ADARUN FASTPATHNO
  • ADARUN FMXIO16
  • ADARUN HEX01HYPEX001
  • ADARUN HEX02HYPEX002
  • ADARUN INTNAS3432
  • ADARUN LBP288000000
  • ltsnipgt

19
Hyperdescriptor Exit Compress
ADACMP
HyperDE Exit
ADALOD
ASSO
DATA
20
Hyperdescriptor Exits -- ADACMP DDCARD
  • ltsnipgt
  • ADARUN DBID919,SVC254
  • ADARUN DEVICE9990,LP65535
  • ADARUN PROGRAMADACMP
  • ADARUN HEX01HYPEX001
  • ADARUN MODEMULTI
  • ltsnipgt

Exit 1 assembler routine located on a load
library, which is part of the ADACMP JCL
21
Hyperdescriptor Exits ADACMP DDKARTE
  • ADACMP COMPRESS
  • ADACMP FNDEF'01,AA,7,A,DE,FI' Field AA
  • ADACMP FNDEF'01,AB,15,A,DE,MU,NU' Field AB
  • ADACMP FNDEF'01,GA' Group GA
  • ADACMP FNDEF'02,AC,15,A,NU' Field AC
  • ADACMP FNDEF'02,AD,2,P,FI' Field AD
  • ADACMP FNDEF'02,AE,5,P,NU' Field AE
  • ADACMP FNDEF'02,AF,6,W' Field AF
  • ADACMP COLDE'7,Y1AF' Collation
    descriptor Y1
  • ADACMP SUBDE'BBAA(1,4)'
    Subdescriptor BB
  • ADACMP SUPDE'CCAA(1,4),AD(1,1)'
    Superdescriptor CC
  • ADACMP HYPDE'1,DD,4,A,MUAB,AC,AD
    Hyperdescriptor DD
  • ADACMP PHONDE'EE(AA)' Phonetic
    descriptor EE
  • ADACMP SUBFN'FFAA(1,2)' Subfield
    FF
  • ADACMP SUPFN'GGAA(1,4),AD(1,1)' Superfield
    GG

22
Hyperdescriptor Exit ADAINV
ADANUC
ADAINV
HyperDE Exit
ASSO
DATA
23
Hyperdescriptor Exits -- ADAINV DDCARD
  • ltsnipgt
  • ADARUN PROGRAMADAINV
  • ADARUN HEX01HYPEX001
  • ADARUN MODEMULTI
  • ltsnipgt

Uses exit located in ADABAS nucleus
24
Hyperdescriptor Exits ADAINV DDKARTE
  • ADAINV INVERT FILExxx
  • ADAINV TEMPSIZE100,SORTSIZE50
  • ADAINV HYPDE'1,DD,4,A,MUAB,AC,AD
  • DD is assigned to hyperexit 1
  • HyperDE DD (A4) consisting of fields
  • AB,AC and AD

25
Hyperdescriptor Exit
26
Hyperdescriptor ExitInput
27
Hyperdescriptor ExitOutput
28
Hyperdescriptor Exit -- Assembler Example
ADABAS.ADA742.SRCE(USERHX01) ADABAS.ADA811.SRCE(
USERHX01) 000021 SAMPLE HYPER-EXIT ROUTINE TO
BE USED TOGETHER WITH 000022 FILE 2
(AUTOMOBILES) TO CREATE THE VALUES FOR THE
000023 HYPERDESCRIPTOR HA
000025
HYPDE'1,HA,20,A,MU,NUAA,AB,AC'
000027 WHERE
000029
FNDEF'1,AA,20,A,NU'
000030 FNDEF'1,AB,20,A,NU'
000031
FNDEF'1,AC,15,A,NU'
000033 THE FIELDS 'AA','AB' AND 'AC' CONTAINS
THE 'MAKE','MODEL' 000034 AND THE
'BODY'-DESCRIPTION OF A CAR. THE VALUES OF
THOSE 000035 FIELDS MAY CONSIST OF TWO
VERBS DELIMITED BY A BLANK. 000036 E.G.
AA'GENERAL MOTORS'.
29
Hyperdescriptor Exit UNIX/Win
30
Hyperdescriptor Exit UNIX/Win
Control Block
31
Hyperdescriptor Exit UNIX/Win
The routines should be written in the C
programming language. The user must be present
as a dynamic shared library. hy_mode
HY_REENTRANT hy_dlng data transfer buffer
length hy_xlng index transfer buffer
length hy_ilng isn transfer buffer length (0
not used) hy_plng periodic transfer buffer
length (0 not used) hy_flng optional own FB
length (0 not used) hy_fptr optional own FB
ltsnipgt See ADABAS 5.1.3 Manual, User Exits and
Hyperexits
32
Hyperdescriptor Exit
Exit only called for update commands, for example
STORE, UPDATE Not used for READ / FIND /
HISTOGRAM 3.3 / 6.2 / 7.1 / 7.4 ? zaps _at_ SL24
33
Use of Hyperdescriptors
  • Create "Superdescriptor" from more than 5 / 20
    basic fields
  • Example from a German company
  • ADA51 Not clear how to handle NU fields
  • Field is in input parameter but leave the exit
    w/o filling the output parameter why NU in
    hyper definition?
  • Customer wishes better documentation and more
    examples

34
Use of Hyperdescriptors
  • Create "Superdescriptor" from variable numbers of
    basic fields
  • Example from SAG-NA

35
Use of Hyperdescriptors
  • Create "Superdescriptor" from variable numbers of
    basic fields and files
  • Example from SAG-NA

36
Use of Hyperdescriptors
  • Translate from lower to upper case
  • Example from the Swiss government Bern
  • Store info in upper/lower case
  • For search in upper case only

37
Use of Hyperdescriptors
  • Translate from lower to upper case and Umlaute
  • Example from a German company, Bremen
  • ä/Ä AE, ü/Ü UE, ß SS, ö/Ö OE
  • Store info in upper case
  • Can be sorted
  • Predict define as HY

38
Use of Hyperdescriptors
  • Create complementary values
  • Example from SAG-NA
  • Numeric values can be read in descending order
  • Since ADA6 hyperexit is no longer necessaryREAD
    IN DESCENDING ORDER

39
Use of Hyperdescriptors
  • Create special phonetic descriptors
  • Summarize (compute) fields
  • Create calculation routines
  • Include compressed superdescriptors to build a
    hyperdescriptor

40
Use of Hyperdescriptors
  • Create tables to check-out data
  • Build special descriptors for record types
    (entities)
  • Suppress values
  • Separate words
  • Build word groups

41
Hyperdescriptor Exit
ADA81For extended MU/PU fields ?HEXV8V7 Must be
linked with existing hyperdescriptor But module
not found inADABAS Version 8.1.0 (Beta Test
II)ADABAS Version 8.1.1 ( L002)
42
File Coupling
  • Type
  • Logical Coupled Files
  • Physical Coupled Files
  • Soft Coupling
  • Natural Code
  • ADABAS Direct Calls
  • Pros and Cons

43
File Coupling
(0-N) belongs to
SALESMEN S-NRA-NRS-NAMES-COMM
AREA A-NRS-NRA-TURNO
points to (N C)
Search salesmen with a commission of gt 30 in an
area with a planned turnover of more than 1
million.
44
File Coupling (Two Views)
DDM DBID 0 DDM FNR 235 SALESMEN T L DB
Name F Leng S D Re - - --
------------------- - ---- - - -- 1 AA S-NR
N 5.0 N D 1 AB A-NR
N 5.0 N D 1 AC S-NAME
A 10 N 1 AD S-COMM N
3.0 N D DDM DBID 0 DDM FNR 236 AREA 1
AA A-NR N 5.0 N D 1 AB S-NR
N 5.0 N D 1 AC A-TURNO
N 8.0 N D
45
Coupled Files (Logical)
0010 DEFINE DATA
0020 LOCAL USING LDA12345 / two views
0030 END-DEFINE
0040 FIND SALESMEN WITH S-COMM
30 0050 FIND AREA WITH
AREA.S-NR SALESMEN.S-NR 0060 AND
A-TURNO gt 1000000 0070
WRITE / TITLE 'Logical coupled - 2 FINDs'
0080 / 'Logical Coupled - 2 FINDs'
0090 / '' /
0100 / 'S-NR from SALESMEN'
SALESMEN.S-NR 0110 / 'A-NR from
SALESMEN' SALESMEN.A-NR 0120 / 'S-NAME
from SALESMEN' SALESMEN.S-NAME 0130 /
'S-COMM from SALESMEN' SALESMEN.S-COMM 0140
/ 'S-NR from AREA....' AREA.S-NR
0150 / 'A-NR from AREA....' AREA.A-NR
0160 / 'A-TURNO from AREA....'
AREA.A-TURNO 0170 / 'ISN from
SALESMEN...' ISN(0040) 0180 / 'ISN
from AREA.......' ISN(0050) 0190
END-FIND
0200 END-FIND
46
Coupled Files (Logical)
Logical Coupled - 2 FINDs
S-NR from
SALESMEN 29 A-NR from SALESMEN
79 S-NAME from SALESMEN HUGO00029
S-COMM from SALESMEN 30 S-NR from
AREA.... 29 A-NR from AREA....
79 A-TURNO from AREA.... 1000001 ISN
from SALESMEN... 15 ISN from
AREA....... 15
47
TEST DBLOG MENU
170535 NATURAL TEST UTILITIES
2006-06-29 User ZINDWS - DBLOG
Menu - Library LBZINDWS



Code Function


B Begin Logging of
Adabas Commands
E End and Display Log Records
S
Snapshot of Specific Adabas Commands
. Exit


Code .. b


Command ..
_Skip ....... _ Program .... COUPLLOG
DBID ..... _FNR ........ _ Line from
.. 0000 Low Resp . _High Resp
.. 9999_Line to .... 0000

Optional Buffers for
Code B
FB .. x RB .. x SB .. x VB .. x IB ..
_
48
Coupled Files (Logical)
No Cmd DB FNR Rsp ISN ISQ 1
S1 200 235 15 1 2 S1
200 236 15 1 3 RC 200
49
Coupled Files (Logical)
TEST DBLOG MENU SALESMEN File 235 Search
Buffer AD,3,U. Value Buffer 030 Format
Buffer AA,005,U,AB,005,U,AC,010,A,AD,003,U. AREA
File 236 Search Buffer AB,5,U,D,AC,8,U,GT. Valu
e Buffer 0002901000000 Format Buffer AA,005,U,A
B,005,U,AC,008,U.
S-NR
S-NR
50
Coupled Files (Logical)
Pros Cons
No denormalization, tables are still relational Two FIND commands
No additional ASSO space

51
Physical Coupling
  • File numbers lt 255
  • One file can be coupled with up to 18 other files
  • Descriptor (DE, UQ, XI) with identical format and
    length in both files

52
Physical Coupling
ADABAS UTILITY to couple two files ADAINV
COUPLE FILES235,236 ADAINV
DESCRIPTORAA,AB ADAINV
TEMPSIZE3335 ADAINV SORTSIZE5738 ADAINV
LWP8268K File 235 (SALESMEN) successfully
processed File 236 (AREA ) successfully
processed
53
Physical Coupling
  • ADABAS REPORT
  • File 235 (SALESMEN )
  • Coupled Files Descriptor AA coupled with
  • Descriptor AB in file 236
  • File 236 (AREA )
  • Coupled Files Descriptor AB coupled with
  • Descriptor AA in file 235

54
Physical Coupling
0010 DEFINE DATA
0020 LOCAL USING LDA12345 / two views
0030 END-DEFINE
0040 FIND SALESMEN WITH
S-COMM 30 0050 AND
COUPLED TO AREA 0060
WITH A-TURNO gt 1000000
0070 WRITE
0080 / 'Physical Coupling - 1 FIND'
0090 / 'FIND SALESMEN AND
COUPLED TO AREA' 0100 /
'' /
0110 / 'S-NR from SALESMEN'
SALESMEN.S-NR 0120 / 'A-NR from
SALESMEN' SALESMEN.A-NR 0130 /
'S-NAME from SALESMEN' SALESMEN.S-NAME
0140 / 'S-COMM from SALESMEN'
SALESMEN.S-COMM 0150 / 'S-NR from
AREA....' AREA.S-NR 0160 / 'A-NR
from AREA....' AREA.A-NR 0170 /
'A-TURNO from AREA....' AREA.A-TURNO
0180 / 'ISN from SALESMEN....' ISN(0040)
0190 / 'ISN from AREA........' 'n/a'
0200 END-FIND
55
Physical Coupling
Physical Coupling - 1 FIND FIND SALESMEN AND
COUPLED TO AREA

S-NR from SALESMEN 29
A-NR from SALESMEN 79
S-NAME from SALESMEN HUGO00029
S-COMM from SALESMEN 30
S-NR from AREA.... 0
A-NR from AREA.... 0
A-TURNO from AREA.... 0
ISN from SALESMEN.... 15
ISN from AREA........ n/a
56
TEST DBLOG MENU
170535 NATURAL TEST UTILITIES
2006-06-29 User ZINDWS - DBLOG
Menu - Library LBZINDWS



Code Function


B Begin Logging of
Adabas Commands
E End and Display Log Records
S
Snapshot of Specific Adabas Commands
. Exit


Code .. b


Command ..
_Skip ....... _ Program .... COUPLPHY
DBID ..... _FNR ........ _ Line from
.. 0000 Low Resp . _High Resp
.. 9999_Line to .... 0000

Optional Buffers for
Code B
FB .. x RB .. x SB .. x VB .. x IB ..
_
57
Physical Coupling
TEST DBLOG MENU No Cmd DB FNR Rsp
ISN ISQ 1 S1 200 235
15 1 2 RC 200 SB/235/AD,3,U,D,/23
6/AC,8,U,GT. VB03001000000 FB
AA,005,U,AB,005,U,AC,010,A,AD,003,U. RB
0002900079HUGO00029 030
58
Physical Coupling
Number of ADABAS Calls ONE S1 (FIND)
Direct Programming File Salesmen 235 File Area
236 Command S5 ???? File
Number 235 Search Buffer /22/PN,D,/103/TO.
59
Physical Coupling
Pros Cons
No denormalization, tables are still relational Uncouple utility before maintenance
Faster access More ASSO space
One FIND only Longer update time
No DATA fields from the soft coupled file(s), in this case AREA
60
Coupled Files (Soft)
0010 DEFINE DATA
0020 LOCAL USING LDA12345 /
two views 0030
END-DEFINE
0040 FIND SALESMEN WITH S-COMM 30
0050 AND COUPLED
TO AREA VIA S-NR S-NR
0060 WITH A-TURNO gt 1000000
0070 WRITE
0080 /
'Soft Coupling - 1 FIND'
0090 / 'FIND SALESMEN AND COUPLED TO
AREA VIA S-NR S-NR' 0100 /
'
' / 0110 / 'S-NR from SALESMEN'
SALESMEN.S-NR 0120 / 'A-NR
from SALESMEN' SALESMEN.A-NR
0130 / 'S-NAME from SALESMEN'
SALESMEN.S-NAME 0140 / 'S-COMM
from SALESMEN' SALESMEN.S-COMM
ltsnipgt 0200 END-FIND
61
Coupled Files (Soft)
Soft Coupling - 1 FIND
FIND SALESMEN AND COUPLED TO AREA VIA S-NR
S-NR

S-NR from SALESMEN 29
A-NR from SALESMEN 79
S-NAME from SALESMEN HUGO00029
S-COMM from SALESMEN 30
S-NR from AREA.... 0
A-NR from AREA.... 0
A-TURNO from AREA.... 0
ISN from SALESMEN.... 15
ISN from AREA........ n/a
62
Coupled Files (Soft)
TEST DBLOG MENU No Cmd DB FNR Rsp
ISN ISQ 1 S1 200 235
15 1 2 RC 200 SB(235,AA,236,AB)/235
/AD,3,U,D,/236/AC,8,U,GT. VB03001000000
FBAA,005,U,AB,005,U,AC,010,A,AD,003,U. RB000290
0079HUGO00029 030
63
Coupled Files (Soft)
  • Supported since
  • ADABAS 5.1 -- (1988)CMD S1FNR 135SB
    (235,AA,236,AB)/235/AD,/236/AC.
  • NATURAL 2.2.1 (lt1998)(FIND COUPLED TO.. VIA

64
Coupled Files (Soft)
Pros Cons
No denormalization, tables are still relational No DATA fields from the soft coupled file, in this case AREA
Only one ADABAS FIND command (S1) L1s
Reduced interregion communication
65
Multi-client Files
  • Since ADABAS 5.3.2, July 1994
  • Functions
  • How to load
  • Pros and cons

66
Multi-client Files
  • The owner ID is assigned to a user ID.
  • A user ID can have only one owner ID, but an
    owner ID can belong to more than one user.
  • Each user can access only the subset of records
    that is associated with the user's owner ID.

67
Multi-client Files
Physical File 20
OWNERID
Multiple Logical Files
OWNERID
OWNERID
68
Loading Multi-client Files
ADALOD LOAD FILE20 ADALOD
LOWNERID2,NUMREC0
Creates file 20 as a multi-client file. The
length of the internal owner ID is two bytes, but
no actual owner ID (ETID) is specified. No
records are actually loaded in the file
(NUMREC0).
69
Loading Multi-client Files
ADALOD LOAD FILE20 ADALOD
LOWNERID2,ETIDUSER1
Creates file 20 as a multi-client file, load all
supplied records, and assign them to user USER1.
The length of the internal owner ID is two bytes.

70
Loading Multi-client Files
ADALOD UPDATE FILE20 ADALOD ETIDUSER2
Performs a mass update to add records to file 20,
a multi-client file. Load all the new records and
assign them to USER2.
71
Loading Multi-client Files
122516 P R E D I C T 4.3.2
2006-08-22
- Modify Adabas attributes -
File ID ......... TEST-BROY
Added 2005-02-28 at 1318 Contained
in DA . TEST by
M197/9 PDBnr ........... 200 PFnr
... 020

Adabas Security
definition
Access level ...........
(0-15)
Update level ........... (0-15)


Loading attributes

Ciphered ............... N (Y,N)
LOWNERID
............... 2 (0-8)
Refresh from program ... N
(Y,N)
Automatic allocation ... Y (Y,N)
PLOG
................... Y (Y,N)
ISN size ..............
0
Erase .................. N (Y,N)
Index
compression ...... N (Y,N)

72
Loading Multi-client Files
73
Users Experiences
A Danish user reported in 2002 to use the feature
since 8 years. (Source SAG-L)
  • Unload production data by using ADAUNLD and
    SEL-CRIT ltswitchgt one-byte descriptor
  • Load into test environment with UPDATE and ETID
  • Coupled ETID as OWNER-ID to the user who wants to
    test.
  • Reset ltswitchgt in production
  • Delete the records in the test-environment by
    coupling the ETID to the userid

74
Users Experiences
  • Keep the unloaded files on request, so they can
    re-load the test set with another ETID.
  • Be aware of file changes between the different
    environments, especially if you keep the unloaded
    files for a while.
  • Be aware of UQ descriptors if you ADALOD UPDATE
    the testset.

75
Users Experiences
A user from Holland (NL) reported in 1999 on
SAG-L
  • We are working with multi-client files in
    development and acceptance environment. It works
    great and smoothly.
  • A little more maintenance sometimes when it comes
    to file changes. Then, you have to
    unload/decompress/compress/load the first set of
    data. And unload/decompress/compress/update the
    others.

76
Thank you!
Questions?
Write a Comment
User Comments (0)
About PowerShow.com