41
Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Embed Size (px)

Citation preview

Page 1: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 1

Modify Internals

Cesare PetrizioInformation Builders

Page 2: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 2

Page 3: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 3

Agenda

MODIFY Internals Database Creation Analysis Phase Transaction Processor Transaction Processor Activation Database Processor Database Actions Database Physical Structure Limits Database Logical Structure File Directory Table File Control Block Pointers

MODIFY Overview

Page 4: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

FOCUS Database

CREATE FILE filename

Initial MODIFY FILE filename

REBUILD/REBUILD or REBUILD/REORG

HOLD FORMAT FOCUS

A FOCUS Database is established by:

Page 5: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

FOCUS Database

MVS/TSO

Database to be used in SU process

Database to be used as part of MAINTAIN or COMBINE

CREATE FILE is required for a FOCUS (or FUSION) database if:

Page 6: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 6

MODIFY Internals

Transaction

Processor

AnalysisFile

Transactions

Log Files

ScreenTransactions

Database

ProcessorDatabase

BINs

Page 7: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 7

Analysis

Open and CHECK Master File Descriptions Verify DBA access to file(s)

Determine I/O access modules required Check DBA and set up access restrictions at SEGMENT

and FIELD levels. Read and parse the FOCEXEC

Establish VALIDATE statements for VALUE restrictions Set up memory for Scratch Pad Area if required Establish DATREC and LINREC Establish Case Processing tables

If COMPILE, create FOCCOMP and exit.

Page 8: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 8

MODIFY InternalsAnalysis

Work Areas DATREC – DATabase-RECord

Retrieval of Database Values Maximum size – 32K

LINREC – LINe RECord Retrieval of Transaction Values Maximum size – 32K COMPUTE and VALIDATE fields are extensions to the

transaction

Page 9: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 9

MODIFY InternalsAnalysis

Work Areas RECDIS - RECord Description

Field Activation Table Maximum 3072 fields

CRTBUF – CRTform BUFfer Last display of CRTFORM Divided into Screens

Page 10: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 10

MODIFY InternalsAnalysis - Work Areas

SEGACT – SEGment ACTivation Segment Activation Table Established per CASE Bits to control

ActivationMove to DATRECMATCH/NOMATCHSEGTYPE and MATCH logic

Page 11: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 11

MODIFY InternalsAnalysis – Special Conditions

SEGACT- SEGment ACTivation COMBINE – SYSTEM99 root segment of each database

is constructed in FOCSORT Indexed MODIFY –

Index is treated as root segment If the index is not the key of its segment, key(s)

must also be MATCHedNo access to segments higher in the hierarchyUPDATE or REJECT only at entry level (no INCLUDE

OR DELETE)Full access to MODIFY subcommands at lower level

segments

Page 12: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 12

MODIFY InternalsAnalysis - Work Areas

SPA (Scratch Pad Area) Width: (Storage Length of fields * 2) + 1 # Rows: Max of REPEAT n

Default 5 rows

Rounded up to nearest 1K Fields:

Every field mentioned in any HOLD REPEAT Every field mentioned in any GETHOLD REPEATEvery field mentioned in CRTFORM field(index)

Page 13: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 13

MODIFY InternalsOrder of Processing

No Cases Transaction Subroutine Non-Position Related Commands MATCH/NEXT to ALL segments

TOP CASE only Transaction Subroutine Non-Position Related Commands MATCH/NEXT to segments specified

Other Cases Non-position Related Commands in order coded MATCH/NEXT to segments specified

If MATCH/NEXT is coded, all GOTO commands are considered ON MATCH/NOMATCH GOTO …

Page 14: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

MODIFY InternalsOrder of Processing - MODIFY

Premise

Action

1 2 3 4 5 6 7 8 9

COMPUTE field/format = ; Y Y

COMPUTE/VALIDATE field/format = expression Y Y Y Y

Same name and format as other field Y N Y Y N N

TOP CASE Y N Y N

GOTO/IF ... GOTO/PERFORM Y Y

MATCH/NEXT prior in case Y N

Non-Positional TYPE/COMPUTE/REPEAT... Y

Analysis Phase, extend LINREC Y Y Y

After first transaction subcommand Y Y

ON MATCH/NOMATCH ... Y

Prior to MATCH/NEXT commands Y Y Y

Order coded Y

Page 15: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 15

MODIFY InternalsDefault MATCH/NOMATCH Actions

MATCH * (MATCH all active fields) MATCH * KEYS (MATCH all active keys) MATCH requires a MATCH to all keys:

WARNING – MATCH ASSUMED Default ON NOMATCH - INCLUDE Default ON MATCH - REJECT

Page 16: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 16

MODIFY Internals

Transaction

Processor

AnalysisFile

Transactions

Log Files

ScreenTransactions

Database

ProcessorDatabase

BINs

Page 17: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 17

MODIFY InternalsTransaction Processing

FREEFORM Default Transaction Type Comma-delimited Maximum LRECL 256 Value Carry-over Comma Dollar (,$) to end transaction

MODIFY FILE CAR

DATA ON CCARS

END

ENGLAND,JAGUAR,V12XKE AUTO,SEDAN,$

CAR=JENSEN,$

Page 18: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 18

MODIFY InternalsTransaction Processing

PROMPT Creates comma-delimited file PROMPT field field field SEG.field END in response to prompt terminates transaction processing PROMPT COUNTRY 5(CAR MODEL) Converts to FREEFORM

MODIFY FILE CAR

PROMPT COUNTRY CAR MODEL

MATCH COUNTRY

ON NOMATCH INCLUDE

DATA

END

Page 19: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 19

MODIFY InternalsTransaction Processing

FIXFORM FIXFORM field/format field/format field/Cn Xn Xn is ignored at the end of any FIXFORM except in TOP

CASE Default format type is A (alpha) Upon reading the transaction, values are moved to

LINREC and with necessary conversion. Invalid format gives FORMAT rejection FORMAT rejection if not in ACCEPT list. Read is performed:

TOP CASEFIXFORM ONWhen required to fulfill request

Page 20: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 20

MODIFY InternalsTransaction Processing

FIXFORM FROM mastername Mastername must describe a single segment

SUFFIX = FIX FILE Actual is used to indicate the input format All fields are conditional FIELDNAME matches to FIELDNAME or ALIAS Used in HOLD FORMAT FOCUS FOC$HOLD.FEX

MODIFY FILE newfile FIXFORM FROM FOC$HOLD DATA ON FOC$HOLD END

Page 21: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 21

MODIFY InternalsTransaction Processing

CRTFORM {LINE n} {UPPER/LOWER} {TYPE n} {WIDTH n} Default Width – 78 columns Default Height -- 24 – TYPE lines <field> Non-conditional field

Blank is acceptable value and will update database <field Conditional field

Blank is considered not present. Creates FIXFORM transaction

Page 22: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 22

MODIFY InternalsCRTFORM – Source of D., T. fields

Henry’s Famous Table

Database Field Re-COMPUTE COMPUTE Field

MATCH

DATREC

Active?

LINREC

LINREC

NOMATCH

Defaults

Not Active

DATREC

Page 23: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

MODIFY InternalsSource of Fields Values on CRTFORM

Premise

Source

1 2 3 4 5 6 7 8 9

INVALID Y

CRTFORM NOCLEAR Y

Index > HOLDCOUNT Y

<field> Y

D.Field or T.field Y Y Y Y Y

Database field Y Y N Y Y

Compute N N Y Y Y

Field ACTIVE Y N

MATCH Y N

DATREC Y Y

LINREC Y Y

CRTBUF Y Y

Defaults Y Y

Blanks Y

Page 24: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 24

MODIFY Internals

Transaction

Processor

AnalysisFile

Transactions

Log Files

ScreenTransactions

Database

ProcessorDatabase

BINs

Activation

Page 25: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 25

MODIFY InternalsActivation

FIELD Activation Controls UPDATE Field is ACTIVE When :

Present on a Transaction Left side of a COMPUTEACTIVATE issued

Field is Deactivated When:UPDATE is performed INCLUDE / DELETE at that levelNavigation to TOP CaseDEACTIVATE issued

Page 26: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 26

MODIFY InternalsActivation

SEGMENT Activation Controls

MATCH INCLUDE

Any field on SEGMENT is Activated Segments lower in the hierarchy activated Segment is Deactivated When:

INCLUDE / DELETE at that levelNavigation to TOP CaseMovement to different segment instance,same level.DEACTIVATE issue

Page 27: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

MODIFY InternalsFIELD and SEGMENT Activation

1 2 3 4 5 6 7 8 9 10

FIXFORM field/format or CRTFORM <field> Y

FIXFORM field/Cformat or CRTFORM <field Y Y

Field value = blank N Y N Y N

CRTFORM <field> or <T.field> Y

CRTFORM <field or <T.field Y Y Y

Transaction value = database value N Y

COMPUTE field= expression; Y

ACTIVATE field Y Y

Field already ACTIVE Y N

Field Activated Y Y Y Y Y Y Y

SEGMENT Activated Y Y Y Y Y Y Y

Value Moved to LINREC Y Y Y Y Y

Default Moved to LINREC Y Y Y

DATREC Value moved to LINREC Y

Page 28: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

MODIFY InternalsFIELD and SEGMENT Deactivation

1 2 3 4 5 6 7 8

INCLUDE Y

UPDATE Y Y

DELETE Y

MOVE TO DIFFERENT SEGMENT INSTANCE Y

DEACTIVATE Y

DEACTIVATE RETAIN Y

TOP CASE Y

All fields on SEGMENT Deactivated Y

Field Deactivated Y Y Y Y Y Y

SEGMENT Deactivated Y Y Y Y Y

Default Values to LINREC Y

Page 29: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 29

MODIFY Internals

Transaction

Processor

AnalysisFile

Transactions

Log Files

ScreenTransactions

Database

ProcessorDatabase

BINs

Page 30: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 30

MODIFY InternalsMATCH

MATCH keyfield(s) Using INDEX

SEGTYPE = S1 or SH1 Root Segment CRTFORM or Trans value < last trans

Beginning of Chain SEGTYPE = ‘ ‘ SEGTYPE = S[H]n,

Trans Value < last trans Current Position

SEGTYPE = S0 SEGTYPE = S[H]n

Trans Value > last trans

Page 31: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 31

MODIFY InternalsNOMATCH

SEGTYPE = S[H]n Prior to searched value

SEGTYPE = S0 End-of-Chain

SEGTYPE = blank End-of-Chain

Explicit MODIFY through index

MODIFY FILE fn.index NO position at NOMATCH

Page 32: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

MODIFY InternalsMATCH

1 2 3 4 5 6 7 8

SEGTYPE = S[H]1 Y Y Y

SEGTYPE = S0 Y

SEGTYPE = blank Y

SEGTYPE = S[H]n Y Y Y

Top Segment Y Y Y

Root key indexed Y Y Y

CRTFORM Y N N

Current Transaction : last Trans < > < > =

Start Beginning of Chain Y Y

Start Current Position Y Y Y

Use Index Y Y

NOMATCH at END-OF-CHAIN Y Y

NOMATCH Prior to searched value Y Y Y Y Y

Page 33: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 33

MODIFY InternalsMovement to DATREC - local mode

MATCH keys ON MATCH CONTINUE

No action (“passing through”) ON MATCH COMPUTE/CRTFORM/VALIDATE

Move segment instance to DATRECTake required action

MATCH WITH-UNIQUES key Retrieves host instance + ALL unique child instances ON MATCH COMPUTE/CRTFORM/VALIDATE Unique segments are considered “logical extensions of the

parent”

Page 34: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 34

MODIFY InternalsMovement to DATREC

NEXT field Entire instance moved to DATREC Key fields are copied to LINREC

COMPUTE/VALIDATE RETURN/I1 = FIND (val IN filename) Index page read into BINs (if necessary) Only RETURN is populated (1 or 0)

COMPUTE/VALIDATE RETURN = LOOKUP([SEG.crfield] condition); Crfield - JOIN segment or [DKU/KU] JOIN and COMBINE are mutually exclusive Value for field(s) moved to DATREC and LINREC Crfield value taken from LINREC

Page 35: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

MODIFY InternalsMATCH

1 2 3 4 5 6 7

MATCH Y Y Y

SU Y N N N Y

ON MATCH COMPUTE Y

NEXT Y

FIND Y

LOOKUP Y Y

MOVE FROM DATABASE TO BINS Y Y Y Y Y

MOVE FROM BINS TO DATREC Y Y Y Y Y

MOVE INDEX PAGE TO BINS Y

SEND DATREC TO USER Y Y

MOVE KEYS FROM DATREC TO LINREC Y Y Y

MOVE NON-KEYS FROM DATREC TO LINREC Y Y

Page 36: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 36

MODIFY Internals

Transaction

Processor

AnalysisFile

Transactions

Log Files

ScreenTransactions

Database

ProcessorDatabase

BINsDatabase

actions

Page 37: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 37

MODIFY InternalsDatabase Actions

INCLUDE Values moved from LINREC To BINS All Active Child Segments INCLUDED Non-SU deleted space may be re-used

UPDATE Specified ACTIVE fields are updated from LINREC to

BINS MATCH WITH-UNIQUES UPDATE might be INCLUDE of

UNIQUE segment DELETE

Segment and all descendant segments are deleted

Page 38: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 38

MODIFY InternalsINDEX Actions

INCLUDE New value and address are moved to index page Full index pages require index page split

UPDATE Index searched and old value deleted New value and address moved to index page Full index pages require index page split

DELETE Index searched and old value deleted

Page 39: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 39

MODIFY InternalsTransaction Counter

Transaction Counter is incremented in first PHYSICAL case with data collection.

CHECK nnnn After nnnn transactions, COMMIT is issued

Default CHECK (no COMMIT specified in MODIFY) LOCAL

CHECK 10 CRTFORMCHECK 1,000 FIXFORM

SUCHECK 1 CRTFORMCHECK 1,000 FIXFORM

SU – CHECK saves all users changes

Page 40: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 40

MODIFY InternalsTransaction Counter

Changes are made into BINs SU and COMMIT

Local User changes to Local Bins SU, not COMMIT

Local User changes sent to Sink and sink BINs “Forced CHECK”

Move from BINs to Database If SHADOW is ON for that database, move to shadow

pages. CHECK or COMMIT

Move any additional pages from BINS to database If SHADOW = ON, update SHADOW directory

Page 41: Copyright 2007, Information Builders. Slide 1 Modify Internals Cesare Petrizio Information Builders

Copyright 2007, Information Builders. Slide 41

QUESTIONS

Thanks for Coming