Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Setting up the Schema Information Area (SIA) with BGSIA

The schema information area (SIA) has to be set up in the DBDIR (database directory) using the BGSIA utility routine.

For this purpose BGSIA requires the information which has been stored in the DBCOM during compilation of the Schema DDL and the SSL. The SIA then contains information in table form on the database schema and its storage structure.

The DBH and other utility routines need the SIA when data has to be stored, retrieved or updated in the user realms.

BGSIA assigns reference numbers to the names of the realms, record types, sets and keys, and it will print them out at the end of its run if requested to do so in a DISPLAY statement. This report is analogous to the one produced by the BPSIA utility routine (see the "Recovery, Information and Reorganization" manual, SIA PRINT REPORT).

BGSIA also generates the UDSHASH module and stores it in the EAM file. This module contains a table with the names of all the hash routines defined in the Schema DDL. After the BGSIA run the UDSHASH module has to be transferred with the attributes RMODE=ANY and AMODE=ANY to a module library with the name dbname.HASHLIB; this also applies if no hash routines are used.

If you have programmed your own hash routines (see the "Design and Definition" manual, Direct access), you must also enter these modules in the HASHLIB.

When required, BGSIA automatically extends the DBDIR of the database being processed. For details, please refer to the “Database Operation” manual, Automatic realm extension by means of utility routines.

At startup BGSIA takes into account any assigned UDS/SQL pubset declaration (see the “Database Operation” manual, Pubset declaration job variable). Faulty assignment leads to the program aborting.

During execution BGSIA requires the linked-in DBH.

Figure 11: System environment for BGSIA

Statements for BGSIA

Statement

Default
value

Meaning

GENERATE SCHEMA
   schema-name

-

Mandatory;
Checks and generates the SIA.

schema-name
name of schema as specified in Schema DDL

RENAME { AREA | RECORD |
         SET }

{’name-oldTO
 ’name-
new’}
[, ...] .


May only be specified in the renaming cycle;
changes the names of record types, sets and user realms

name-old:
name which is to be changed
name-new
new name

The renaming of and changes to items in record types cannot be specified here.

DISPLAY [SCHEMA    schema-name]

-

Optional;
Prints the SIA generated by BGSIA

schema-name
name of schema as specified in GENERATE statement

It is sufficient to specify DISPLAY.

END

-

mandatory;
terminates statement input

Table 13: Statements for BGSIA

Command sequence for starting BGSIA

It is assumed for the command sequence described here that UDS/SQL was installed with IMON (see section "START commands for the UDS/SQL programs").

01 /DELETE-SYSTEM-FILE FILE-NAME=*OMF

02 /ADD-FILE-LINK LINK-NAME=DATABASE,FILE-NAME=dbname.DBDIR

03 /SELECT-PRODUCT-VERSION PRODUCT-NAME=UDS-SQL,VERSION=version,SCOPE=*TASK

04 /START-UDS-BGSIA

05 bgsia-statements

06 END

03

The version-independent module of the linked-in DBH of the relevant version is loaded dynamically (see the section entitled "Compiling, linking and loading UDS/SQL-TIAM appliction programs" in the "Application Programming" manual).

04

The UDS/SQL utility routine can also be started with the alias BGSIA.

Entering the UDSHASH module in the HASHLIB

01 /START-LMS

02 //OPEN-LIB LIB=dbname.HASHLIB,MODE=*UPDATE(STATE=*NEW)

03 //ADD-ELEMENT FROM-FILE=*OMF,TO-ELEMENT=*LIBRARY-ELEMENT(TYPE=R)

04 //END

  
Example

/DELETE-SYSTEM-FILE FILE-NAME=*OMF
/ADD-FILE-LINK LINK-NAME=DATABASE,FILE-NAME=TRAVEL.DBDIR
/SELECT-PRODUCT-VERSION PRODUCT-NAME=UDS-SQL,    VERSION=02.9B00 
/START-UDS-BGSIA
***** START        BGSIA        (UDS/SQL  V2.9  1801 )     2019-01-29   09:26:55
GENERATE TRAVEL-AGENCY 
DISPLAY  
END   
%  UDS0215 UDS STARTING UDS/SQL V2.9(LINKED-IN), DATE=2019-01-29 (ILL2038,09:26:55/4TE7)  
%  UDS0746 UDS PUBSET DECLARATION (CURRENT) FOLLOWS (ILL1746,09:26:55/4TE7)  
4TE7: UDS-PUBSET-JV:  :4TE7:$XXXXXXXX.PUBSDECL.PUBS  
4TE7: PUBSETS:        4TE7
4TE7: DEFAULT PUBSET: 4TE7
4TE7: ------------------------------------------
ESTIMATE-REPORT
********** FOR USER-REALM     3 NAME IS : TRAVEL-RLM  
      A SIZE OF        147 BLOCKS WAS ESTIMATED   
END OF ESTIMATE-REPORT 
% UDS0758 NUMBER OF DML-STATEMENTS AND I/O COUNTERS PER DATABASE  (ILL1758,09:26:55/4TE7)  
 4TE7: DATABASE NAME      DMLS   LOG READ  PHYS READ  LOG WRITE PHYS WRITE
 4TE7: -------------------------------------------------------------------
 4TE7: TRAVEL             1179       1310         61        276         35
%  UDS0213 UDS NORMAL SYSTEM TERMINATION WITH ************1179 DML-STATEMENTS 2019-01-29
(ILLY033,09:26:56/4TE7)
  
***** DIAGNOSTIC SUMMARY OF BGSIA 
              NO WARNINGS 
              NO ERRORS  
              NO SYSTEM-ERRORS
   
***** END OF DIAGNOSTIC SUMMARY 
***** NORMAL END   BGSIA       (UDS/SQL  V2.9 1801 )     2019-01-29   09:26:56
/ASSIGN-SYSDTA TO-FILE=*SYSCMD
/MODIFY-JOB-SWITCHES ON=(1,4)
/START-LMS 
//MODIFY-LOGGING-PARAMETERS LOG=*MAX
//OPEN-LIBRARY LIB=TRAVEL.HASHLIB,MODE=*UPDATE
 LIBRARY IS CLEARED AND PREPARED
//ADD-ELEMENT FROM-FILE=*OMF,TO-ELEM=*LIB-ELEM(TYPE=R),WRITE-MODE=*ANY
  
INPUT  OMF
OUTPUT LIBRARY= :IUDS:$XXXXXXXX.TRAVEL.HASHLIB
        ADD UDSHASH AS (R)UDSHASH/@(0001)/2019-01-29 
//SHOW-ELEM-ATTR
  
INPUT  LIBRARY= :IUDS:$XXXXXXXX.TRAVEL.HASHLIB
TYP NAME    VER (VAR#) DATE
(R) UDSHASH @   (0001) 2019-01-29
      1 (R)-ELEMENT(S) IN THIS TABLE OF CONTENTS
//END

SIA report

The SIA report printed by DISPLAY is almost identical to the report printed by the BPSIA utility routine. At some points it does not contain its definitive values, since certain values are entered at a later stage by BFORMAT. The report is described in detail in "SIA PRINT REPORT" in the "Recovery, Information and Reorganization" manual.

Description of the ESTIMATE-REPORT

In the BGSIA run listing the start message is followed by the ESTIMATE REPORT, which serves to estimate the size of the user realms.

This is necessary because, for example, when a user realm is not large enough, BFORMAT does not perform formatting if the realm concerned is not automatically extendable. For details, please see the “Database Operation” manual, Automatic realm extension by means of utility routines.

The ESTIMATE-REPORT always outputs the following information:

  • realm number

  • realm name

  • realm size (in database pages)
    The value that is output for the realm size by ESTIMATE-REPORT must be interpreted differently, depending on the database page format (2-Kbyte, 4-Kbyte or 8-Kbyte), and cannot be directly used in the CREATE-FILE command, for example. In the case of the CREATE-FILE command, the value for “SPACE=“ is specified in units of 2K (BS2000 half pages), whereas the ESTIMATE-REPORT returns size specifications in units of a “database page”. Consequently, when converting to 2K units, the sizes given in the ESTIMATE-REPORT for a 4-Kbyte database must be multiplied by a factor of 2, and those for an 8-Kbyte database must be multiplied by a factor of 4.

ESTIMATE-REPORT outputs additional information in the following cases:

  • The realm contains records for which the COMPRESSION clause was specified in the SSL.

  • There are records with variable items in the realm.

  • SEARCH key tables have been created with DUPLICATES ALLOWED and TYPE IS DATABASE-KEY-LIST.

Reference values needed for correction purposes are output in a correction table. These values are needed to make corrections if the percentage of space saved for the records is not as high as the default assumption for the ESTIMATE-REPORT.

The following table lists all options together with an explanation of the variables:

Entries in ESTIMATE-REPORT              

Explanation of variables

**** FOR USER-REALM realm-ref NAME IS: realm-name

Realm number;
Realm name

A SIZE OF size BLOCKS WAS ESTIMATED

Realm size in data pages; serves as a reference value for the amount of space needed for the specified user realm

** THE RECORD rec-ref NAME IS record-name

Record type number;
name of the record type for which the COMPRESSION clause applies

WITH * COMPRESSION * WAS CALCULATED
WITH A PROFIT OF 50%

The calculation of the realm size was based on the assumption that the saving due to COMPRESSION for the specified record type would be 50%.

CORRECTION-TABLE:
0% 25% 75%
n+  n+  n-

Correction table (only for COMPRESSION);
n indicates the number of data pages that must be added (+) to or subtracted from (-) the realm size size for savings of 0% / 25% / 75% .

**** IN SET set-ref
NAME IS: set-name
FOR RECORD rec-ref

Set number;
Set name;
Record reference number;

A SEARCH-KEY-TABLE TYPE *

DATABASE-KEY-LIST *
WAS CALCULATED WITH 50% DUPLICATES

Calculation of the size of the DATABASE-KEY-LIST was based on the assumption that 50% of the key values would be duplicates.

CORRECTION-TABLE:
0% 75% 90%
n+  n-  n-

Correction table;
n indicates the number of data pages that must be added to or subtracted from the realm size size on the assumption that 0% / 75% / 90% of the key values are duplicates.

Table 14: Variables in the ESTIMATE-REPORT

The suggested realm sizes are intended as an aid to determining orders of magnitude. They may be imprecise for the following reasons:

  • SSL population specifications (DBTT, RECORD POPULATION, SET POPULATION) are inaccurate.

  • The saving cannot be predicted with 100% accuracy (e.g. for record types subject to the COMPRESSION clause or containing a variable data item).

  • The number of key duplicates is not known for SEARCH key tables with DUPLICATES ALLOWED,
    TYPE IS DATABASE-KEY-LIST.

  • The number of overflow pages cannot be predicted for LOCATION MODE IS CALC or for CALC SEARCH keys.

  • The size of the unused storage space cannot be calculated due to mixed storage.

  • In tables, the size may vary according to the order in which the data is stored.

  • INCREASE is not taken into account.

The ESTIMATE-REPORT assumes maximum values for records. SINCE these values are unlikely to be achieved at the beginning, smaller user realms can be set up initially. These realms can be extended later by using the BREORG utility routine (see the "Recovery, Information and Reorganization" manual).

You can also configure realms in such a way that they can be extended online when required (see the “Database Operation” manual, The online realm extension process).

 
Example

ESTIMATE-REPORT 
********** FOR USER-REALM     3 NAME IS : CUSTOMER-ORDER-RLM  
     A SIZE OF         56 BLOCKS WAS ESTIMATED
    
********** FOR USER-REALM     4 NAME IS : PURCHASE-ORDER-RLM 
     A SIZE OF         78 BLOCKS WAS ESTIMATED  
  
********** FOR USER-REALM     5 NAME IS : CLOTHING 
     A SIZE OF         67 BLOCKS WAS ESTIMATED 
     *** THE RECORD     8 NAME IS : ART-DESCR 
          WITH *COMPRESSION* WAS CALCULATED WITH A PROFIT OF 50% 
          CORRECTION-TABLE :     0%       25%     75% 
                                 17+      8+      8-
   
     **** IN SET    28 NAME IS : SYS_INSTALLMENT 
          FOR RECORD     5 NAME IS : INSTALLMENT 
          A SEARCH-KEY-TABLE TYPE *DATABASE-KEY-LIST*
          WAS CALCULATED WITH 50% DUPLICATES  
          CORRECTION-TABLE:      0%       75%     90% 
                                 0+       0-      0- 
  
********** FOR USER-REALM     6 NAME IS : HOUSEHOLD-GOODS
     A SIZE OF         33 BLOCKS WAS ESTIMATED 
     *** THE RECORD     8 NAME IS : ART-DESCR
          WITH *COMPRESSION* WAS CALCULATED WITH A PROFIT OF 50% 
          CORRECTION-TABLE :     0%       25%     75% 
                                 8+       4+      4-
.
.
.
     **** IN SET    12 NAME IS : ARTICLES-AVAILABLE 
          FOR RECORD     9 NAME IS : ARTICLE  
          A SEARCH-KEY-TABLE TYPE *DATABASE-KEY-LIST* 
          WAS CALCULATED WITH 50% DUPLICATES 
          CORRECTION-TABLE:      0%       75%     90% 
                                 3+       0-      3-  
.   
.
.
********** FOR USER-REALM    11 NAME IS : ARTICLE-RLM 
     A SIZE OF         85 BLOCKS WAS ESTIMATED  
END OF ESTIMATE-REPORT