Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Compiling the Subschema DDL

The Subschema DDL (SDDL) is compiled by the same DDL compiler as the Schema DDL. The SDDL compiler statements are described in table 12 of "Compiling the Schema DDL".

The Subschema DDL must be assigned as an input file to the DDL compiler. When compilation is finished, the compiled subschema description is stored in the DBCOM (Database Compiler Realm). Later BGSSIA uses this information to set up the SSIA in the DBDIR (Database Directory). In addition, the DDL compiler stores the transformed subschema derived from the compiled subschema description in the COSSD and creates a check table (CHECK-TABLE) for this subschema. This information is required by the COBOL compiler for the syntax and semantic checks of the DML statements.
When a subschema which is also to be used in KDBS applications is compiled, you must specify the DDL compiler statement “SUBSCHEMA FORM IS OLD” (see Table12 of "Compiling the Schema DDL"). The DDL compiler then creates the transformed subschema and the CHECK-TABLE in the format of UDS/SQL V1.2 (“old” format with 1-byte long reference numbers for record types and sets; see Table12 of "Compiling the Schema DDL").

The COSSD is also used as input for the BCALLSI utility routine (see "Additional measures for CALL DML programs with BCALLSI"). BCALLSI generates the SSITAB module, which makes the subschema information available to CALL DML programs.

After the subschemas are compiled, the DB administrator should save the database (see section "Saving the database"). This ensures that a consistent backup of the database exists.

The subschema determines the RECORD AREA.
The length of this record area is equal to the total lengths of all record types contained in the underlying subschema (aligned on a double-word boundary) and all implicitly defined data items, i.e. ALIAS items and AREA-IDs for distributed record types.
The DDL compiler aborts the compilation of the subschema with an error as soon as the associated record area exceeds 65 535 bytes (or 61 328 bytes if SUBSCHEMA FORM IS OLD was specified).

Figure 13: System environment for subschema compilation

Command sequence for compiling the subschema

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

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

03 /START-UDS-DDL

04 sddl-compiler-statements

05 END

02

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).

03

04

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

The individual statements can be entered in one line if they are separated by commas or blanks.

Example

/ADD-FILE-LINK LINK-NAME=DATABASE,FILE-NAME=TRAVEL.DBDIR 
/SELECT-PRODUCT-VERSION PRODUCT-NAME=UDS-SQL,    VERSION=02.9B00  
/START-UDS-DDL
***** START        DDLCOMP      (UDS/SQL  V2.9  1801 )    2019-01-29   09:26:59
*  DDLCOMP: INPUT SYSTEMPARAMETERS
SOURCE IS 'S.TRAVEL.SUBDDL'                                             
END                                                                     
*  DDLCOMP: READ SCHEMA/SUBSCHEMA       
%  UDS0215 UDS STARTING UDS/SQL V2.9 (LINKED-IN), DATE=2019-01-29 (ILL2038,09:26:59/4TE7) 
%  UDS0746 UDS PUBSET DECLARATION (CURRENT) FOLLOWS (ILL1746,09:26:59/4TE7) 
4TE7: UDS-PUBSET-JV:  :IUDS:$XXXXXXXX.PUBSDECL.PUBS                         
4TE7: PUBSETS:        IUDS
4TE7: DEFAULT PUBSET: IUDS
4TE7: ------------------------------------------
*  DDLCOMP: START SUBSCHEMA-PHASE
*  DDLCOMP: CHECK SUBSCHEMA RULES
*  DDLCOMP: CHECK DATA ALLOCATION
*  DDLCOMP: SUBCOPY
*  DDLCOMP: ERROR DIAGNOSTIC
*  DDLCOMP: NO ERRORS IN SUBSCHEMA-PHASE
*  DDLCOMP: WRITE SUBSCHEMA ON COSSD
*  DDLCOMP: NO ERRORS DETECTED
%  UDS0758 NUMBER OF DML-STATEMENTS AND I/O COUNTERS PER DATABASE (ILL1758,09:26:59/4TE7)
 4TE7: DATABASE NAME      DMLS   LOG READ  PHYS READ  LOG WRITE PHYS WRITE
 4TE7: -------------------------------------------------------------------
 4TE7: TRAVEL             3011       5388         77       1249         57
%  UDS0213 UDS NORMAL SYSTEM TERMINATION WITH ************3011 DML-STATEMENTS 2019-01-29
(ILLY033,09:27:00/4TE7)
  
***** DIAGNOSTIC SUMMARY FOR DDL-SUBSCHEMA 
  
              NO ERRORS   
              NO WARNINGS 
  
***** END OF DIAGNOSTIC SUMMARY 
***** NORMAL END   DDLCOMP      (UDS/SQL  V2.9  1801 )     2019-01-29   09:27:00